将DateTimeOffset转换为军事时间VB.NET

时间:2022-07-25 21:09:18

I am needing to convert a DateTimeOffset {2/5/2014 2:28:13 PM -06:00} to Military time of 02/05/2014 14:28:13 and without the PM or the -6:00.

我需要将DateTimeOffset {2/5/2014 2:28:13 PM -06:00}转换为军事时间02/05/2014 14:28:13并且没有PM或-6:00。

SOLVED: I currently have this: row.TimeStamp is DateTimeOffset {2/5/2014 2:28:13 PM -06:00}

已解决:我目前有这个:row.TimeStamp是DateTimeOffset {2/5/2014 2:28:13 PM -06:00}

thisTime = row.TimeStamp.DateTime
currTime = Format(thisTime, "yyyy/M/dd HH:mm:ss")

1 个解决方案

#1


3  

for row.TimeStamp = {2/5/2014 2:28:13 PM -06:00}

for row.TimeStamp = {2/5/2014 2:28:13 PM -06:00}

thisTime = row.TimeStamp.DateTime
currTime = Format(thisTime, "yyyy/M/dd HH:mm:ss")

currTime is then {2014/02/05 14:28:13}

然后是currTime {2014/02/05 14:28:13}

#1


3  

for row.TimeStamp = {2/5/2014 2:28:13 PM -06:00}

for row.TimeStamp = {2/5/2014 2:28:13 PM -06:00}

thisTime = row.TimeStamp.DateTime
currTime = Format(thisTime, "yyyy/M/dd HH:mm:ss")

currTime is then {2014/02/05 14:28:13}

然后是currTime {2014/02/05 14:28:13}