Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
由于在 VBA 中获取时区太复杂了,我只需要在函数末尾添加“PST”文本字符串,Now()因此它看起来像太平洋标准时间下午 12:30
Now()
只是时间而已,到目前为止我...
Range("a1).Value = Format(Time, "HH:MM am/pm" PST)
这是不对的:D
Range("a1").Value = Format(Time, "HH:MM am/pm") & " PST"
可以在格式字符串中包含 PST,但我更愿意将其单独分开:
Range("a1").Value = Format(Time, "HH:MM am/pm P\ST")
需要用 \S 对 S 进行转义,否则它会插入秒。
Range("A1").Value = Format(Time, "HH:MM am/pm") & " PST"