Getting an ISO8601 formatted Date using Domino @Formula
I recently had a need to show a domino view column in ISO 8601 date/time format. I was really hoping that as Notes uses this format in many of it's representations in Notes XML views that there would be something like a simple @TEXT option, sadly there isn't. I wouldn't recommend using this in a view column directly, put a computed text field in your document that stores it, and refer to that in your view column.
So here's the formula that will return a date in UTC (zulu) time, assuming I want to use the Created date for the document
TimetoConvert := @Created;
DocTime := @TIMEMERGE(TimetoConvert ;TimetoConvert ;"Z=0$DO=1$DL=3 -1 1 10 -1 1$ZX=36$ZN=GMT");
Year:= @Text (@Year(DocTime));
Month := @If(@Month(DocTime) < 10;"0";"") + @Text(@Month(DocTime));
Day := @If(@Day(DocTime) < 10;"0";"") + @Text(@Day(DocTime));
Hours := @If(@Hour(DocTime) < 10;"0";"") + @Text(@Hour(DocTime));
Minutes := @If(@Minute(DocTime) < 10;"0";"") + @Text(@Minute(DocTime));
Seconds := @If(@Second(DocTime) < 10;"0";"") + @Text(@Second(DocTime));
Year + "-" + Month + "-" + Day +"T" +Hours + ":" + Minutes + ":" + Seconds + "Z"
If you're wondering what "Z=0$DO=1$DL=3 -1 1 10 -1 1$ZX=36$ZN=GMT" actually means, it's basically the Domino Time Zone code for GMT with no Daylight savings, aka Universal Time(zulu time). Anyway you'll have to continue to wonder what the format means exactly, to quote one of the best lines in an IBM support document ever.
he third parameter of the method contains a lengthy text string which represents the relative time zone (for example the string for Easter Daylight Time is "Z=5$DO=1$DL=4 1 1 10 -1 1$ZX=25$ZN=Eastern"). There is no documentation on these parameters, and in order to determine the correct string for the time zone you would like to use it is suggested that you create a sample form with a field with the type 'Timezone'.
How about someone documents the parameters? It must be on an internal IBM spec that defined this function when they wrote it, surely someone could document it for the public?
I hear Domino 8.5 is much better at this with XPages, but I can't run my server on Domino 8.5 until a supported Sametime version is shipped.



