代码之家  ›  专栏  ›  技术社区  ›  khashashin

设置会议项开始日期和结束日期的格式

  •  1
  • khashashin  · 技术社区  · 8 年前

    AppointmentItem.Start 如果我理解正确,则返回事件的开始时间,在我的案例中,返回时间的格式如下:
    "29.05.2018 08:00:00"
    如何将其格式化为:
    "2018-05-29T08:00:00" 我可以用“-”代替圆点,但也许有更好的方法。 我需要把这一年移到开始。

    同样的格式返回appointmentitem。end我也要格式化它

    1 回复  |  直到 8 年前
        1
  •  0
  •   Ricardo A    8 年前
    Dim sTime As String
    Dim eTime Ss String
    sTime = AppointmentItem.Start
    eTime = AppointmentItem.End
    sTime = Format(sTime, "yyyy-mm-dd hh:mm:ss")
    eTime = Format(eTime, "yyyy-mm-dd hh:mm:ss")
    
    MsgBox "Start: " & sTime & " End: " & eTime