I’m trying to get the time in the following format: hh:mm:ss. For example, 7:01:02 PM
If i use the following in a rule
https://lab.sharptools.dev/date?timezone=Canada/Eastern
and then store it in a variable using
{{$context.response.data.hh}}:{{$context.response.data.mm}}:{{$context.response.data.ss}} {{$context.response.data.A}}
why does the data appear as
7:1:2 PM, without the leading zeros. I’m most concerned about them in the minutes and seconds fields.
Using the http request in the browser gives me the correct data.
{
“timezone”: “Canada/Eastern”,
“locale”: “en”,
“iso”: “2022-10-18T19:01:02-04:00”,
“utc”: “2022-10-18T23:01:02+00:00”,
“unix”: 1666134062,
“millis”: 1666134062798,
“daysInMonth”: 31,
“YY”: “22”,
“YYYY”: “2022”,
“M”: “10”,
“MM”: “10”,
“MMM”: “Oct”,
“MMMM”: “October”,
“D”: “18”,
“DD”: “18”,
“d”: “2”,
“dd”: “Tu”,
“ddd”: “Tue”,
“dddd”: “Tuesday”,
“H”: “19”,
“HH”: “19”,
“h”: “7”,
“hh”: “07”,
“m”: “1”,
“mm”: “01”,
“s”: “2”,
“ss”: “02”,
“SSS”: “798”,
“Z”: “-04:00”,
“ZZ”: “-0400”,
“A”: “PM”,
“a”: “pm”,
“w”: “43”,
“W”: “42”
}