GMT / Universal Time inspector?

(imported topic written by cstoneba)

I have a property that looks at a bunch of client settings and outputs a date/time in the format that the IEM client can understand it (Mon, 03 Mar 2014 15:00:00 -0600). The Day through the Time are all retreived by client settings, but the -0600 time zone is added by the inspector “as local time”.

However, I now need this time/date of Mon, 03 Mar 2014 15:00:00 -0600 to be as UTC Universal Time/GMT +0000 rather than central time. I’ve tried adding “as universal string”, “as universal time”, and “as universal time zone”, but nothing seems to work.

Does anyone know how to switch a time from local time to GMT?

(imported comment written by nberger91)

Output from my client configured for UTC -5:00.

q:

now

as

string

A:
Mon, 03 Mar 2014 13:02:48 -0500

T:
0.072 ms

q:

now

as

universal string

A:
Mon, 03 Mar 2014 18:02:48 +0000

T:
0.070 ms

(imported comment written by cstoneba)

agreed, that works when using “now”, but it doesn’t work in this way (and this is now I need it to):

//works for local time

q: “Mon, 03 Mar 2014 13:02:48” as local time

A: Mon, 03 Mar 2014 13:02:48 -0600

T: 0.028 ms

//doesn’t work for UTC

q: “Mon, 03 Mar 2014 13:02:48” as universal time

A: Mon, 03 Mar 2014 07:02:48 -0600

T: 0.034 ms

//Doesn’t work for UTC

q: “Mon, 03 Mar 2014 13:02:48” as universal string

E: The operator “universal string” is not defined.

(imported comment written by nberger91)

does this set you on the right track ?

q: time (universal time zone) of time “Mon, 03 Mar 2014 14:22:47 -0500”

A:19:22:47 +0000

T:0.082 ms

q:

date (universal time zone)

of

time

“Mon, 03 Mar 2014 19:08:25 +0000”

A:
Mon, 03 Mar 2014

T:
0.087 ms

(imported comment written by cstoneba)

this is close (time (universal time zone) of time “Mon, 03 Mar 2014 14:22:47 -0500”), but is just displaying the time.

how would you go from “Mon, 03 Mar 2014 14:22:47 -0500” to “Mon, 03 Mar 2014 19:08:25 +0000” ?

(imported comment written by nberger91)

q:

concatenation

" "

of

(date (universal time zone)

of

time

“Mon, 03 Mar 2014 19:08:25 +0000”

as

string
;
time (universal time zone)

of

time

“Mon, 03 Mar 2014 14:22:47 -0500”

as

string)

A:
Mon, 03 Mar 2014 19:22:47 +0000

(imported comment written by cstoneba)

but there is no way to take the existing date and time logic and instead of it being calculated as local time, calculate it as UTC?

this is what I’m working with and it is currently “As local time”, but I want it to be as “universal time”, but without having to concat too much additional items to it.

(((((first ((if (it = “0”) then (“Sunday”) else if (it = “1”) then (“Monday”) else if (it = “2”) then (“Tuesday”) else if (it = “3”) then (“Wednesday”) else if (it = “4”) then (“Thursday”) else if (it = “5”) then (“Friday”) else if (it = “6”) then (“Saturday”) else nothing) of (value of setting “day_0” of client) as day_of_week) of (current month_and_year - 1*month)) + ((value of setting “week_number_day_0” of client as integer - 1)*week) + ((value of setting “days_after_day_0” of client as integer)*day)) as string) & " " & (value of setting “time” of client as integer *minute)as string) as local time)

(imported comment written by MattPeterson)

Is this what your looking for?

q: “Mon, 03 Mar 2014 14:22:47 -0500” as time as universal string

A: Mon, 03 Mar 2014 19:22:47 +0000

T: 0.043 ms

I: singular string

(imported comment written by cstoneba)

nice. That gets it to look right, however as you can see, it is a “singular string”, not a “singular time”.

(imported comment written by MattPeterson)

q:

“Mon, 03 Mar 2014 14:22:47 -0500”

as

time

as

universal string

as
time

A:
Mon, 03 Mar 2014 13:22:47 -0600

T:
0.065 ms

I:
singular time

(imported comment written by cstoneba)

got it working off that. thanks