I am trying to format my existing relevance date and time stamp to meet the below requirement
existing relevance
(year of it as string & month of it as two digits & day_of_month of it as two digits ) of date(universal time zone) of it & " "& (two digit hour of it as string & ":" & two digit minute of it as string & ":" & two digit second of it as string) of time (universal time zone) of it) of now
requested format
Here is the correct format for
UTC time
2015-12-20 01:00:00.0000000 -06:00
where:
YYYY =
four-digit year
MM = two-digit month (01=January, etc.)
DD = two-digit day of month (01 through 31)
hh = two digits of hour (00 through 23) (am/pm NOT allowed)
mm = two digits of minute (00 through 59)
ss = two digits of second (00 through 59)
s = one or more digits representing a decimal fraction of a
second
TZD = time zone designator (Z or +hh:mm or -hh:mm). In the example above,
this time represents a 6 hour offset from GMT in order to determine the current
local time.
No I could not figure out how to add the GMT offset highlighted below. I was able to append the decimal fraction of a second by adding .0000000 to the relevance statement but could not get the -06:00 GMT offset to work.
Q: now as string as universal time
A: Fri, 12 Feb 2016 14:33:06 -0800
T: 0.044 ms
I: singular time
Q: (".0000000 " & following text of last " " of (it as string)) of now
A: .0000000 -0800
T: 0.048 ms
I: singular string
This is missing the hour/min/sec:
Q: ((((year of it as string &"-"& month of it as two digits &"-"& day_of_month of it as two digits) of date (universal time zone) of it) of it) & " " & ".0000000 " & following text of last " " of ((it as string) of time (universal time zone) of it)) of now
A: 2016-02-12 .0000000 +0000
T: 0.080 ms
I: singular string
Same thing, but using local time zone instead:
Q: ((((year of it as string &"-"& month of it as two digits &"-"& day_of_month of it as two digits) of date (local time zone) of it) of it) & " " & ".0000000 " & following text of last " " of ((it as string) of time (local time zone) of it)) of now
A: 2016-02-12 .0000000 -0800
T: 0.089 ms
I: singular string
If you use this, then the offset will always be +0000 and not the local time zone. Which one you want to use depends on what you are trying to do, but you should always use one or the other and not a mix of both.