Quote from
Gaev on May 26, 2024, 3:43 am
@asmat
1) for the variable property of TimeInput1, change x to [x]
2) Now, when I select 1:07 AM, [x] is displayed as "1970-01-01T06:07:00.000Z" ... the date and time are separated by T
a) replace Z with nothing
b) replace double quotes with nothing
c)) parse the remaing text into an array using T as the separator ... the second array variable now contains 06:07:00.000
d) parse this into array using : as the separator ... the first two array variables are 06 and 07 ... let us call them [myHH] and [myMM] ... [myHH] is 5 more than i input because my local time (Toronto) is 5 hours behind UTC/GMT ... so add/subtract this amount to obtain the [myHH] in your locale.
e) if resulting [myHH] is greater than 12, subtract 12 from [myHH] and set [ampm] to "PM" ... else leave [myHH] as is and set [ampm] to "AM"
Your answer is [myHH]:[myMM] [ampm]
If I select 06:10 PM, applying logic 2 (a) to (e) above, [x] (displayed as "1970-01-01T23:10:00.000Z") will return 06:10 PM
Let me know if something is unclear or does not work.
@asmat
1) for the variable property of TimeInput1, change x to [x]
2) Now, when I select 1:07 AM, [x] is displayed as "1970-01-01T06:07:00.000Z" ... the date and time are separated by T
a) replace Z with nothing
b) replace double quotes with nothing
c)) parse the remaing text into an array using T as the separator ... the second array variable now contains 06:07:00.000
d) parse this into array using : as the separator ... the first two array variables are 06 and 07 ... let us call them [myHH] and [myMM] ... [myHH] is 5 more than i input because my local time (Toronto) is 5 hours behind UTC/GMT ... so add/subtract this amount to obtain the [myHH] in your locale.
e) if resulting [myHH] is greater than 12, subtract 12 from [myHH] and set [ampm] to "PM" ... else leave [myHH] as is and set [ampm] to "AM"
Your answer is [myHH]:[myMM] [ampm]
If I select 06:10 PM, applying logic 2 (a) to (e) above, [x] (displayed as "1970-01-01T23:10:00.000Z") will return 06:10 PM
Let me know if something is unclear or does not work.
luishp, Vadim and asmat have reacted to this post.