
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Convert Regular Time to Military Time
I have a date and time field with the time field in regular time (AM/PM). I want to convert the combination into military time. The date field is Service Date and the time field is Service.Service Start Time. Any help would be appreciated. Thanks in advance.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@glcordell you can try :
TimeStamp(Timestamp#(RegularTime,'MM-DD-YYYY hh:mm:ss TT'),'MM-DD-YYYY hh:mm:ss') as MilitaryTime
for example :
Data:
load
*,TimeStamp(Timestamp#(RegularTime,'MM-DD-YYYY hh:mm:ss TT'),'MM-DD-YYYY hh:mm:ss') as MilitaryTime
inline [
RegularTime
09-03-20 9:07:28 AM
];
output:
Taoufiq ZARRA
"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "
(you can mark up to 3 "solutions") 😉

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@glcordell you can try :
TimeStamp(Timestamp#(RegularTime,'MM-DD-YYYY hh:mm:ss TT'),'MM-DD-YYYY hh:mm:ss') as MilitaryTime
for example :
Data:
load
*,TimeStamp(Timestamp#(RegularTime,'MM-DD-YYYY hh:mm:ss TT'),'MM-DD-YYYY hh:mm:ss') as MilitaryTime
inline [
RegularTime
09-03-20 9:07:28 AM
];
output:
Taoufiq ZARRA
"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "
(you can mark up to 3 "solutions") 😉

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks so much!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
do you get it in this form "2023-07-12T10:55:16Z"?
With T as a sepperator or is this impossible?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do this.
Timestamp(Timestamp#(DateField, 'YYYY-MM-DDThh:mm:ssZ'), 'YYYY-MM-DD hh:mm:ss')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, I mean transform it into this form. "2023-07-12T10:55:16Z" should be the end result. How has the format to be written that the result is in the form of "2023-07-12T10:55:16Z"?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@human My bad, in that case perhaps this.
Date(Date#(RegularTime, 'MM-DD-YYYY hh:mm:ss TT'), 'YYYY-MM-DD') & 'T' & Time(Date#(RegularTime, 'MM-DD-YYYY hh:mm:ss TT'), 'hh:mm:ss') & 'Z' as FormattedDateTime
