Hi Randy,
fn:implicit-timezone() may come in handy here. It returns your current local timezone:
http://www.xqueryfunctions.com/xq/fn_implicit-timezone.html
Best, Christian ___________________________
On Wed, Dec 12, 2012 at 12:13 AM, Randy reed randywreed@gmail.com wrote:
Hi All,
I wrote a xquery in Basex that created an xml file that calculated student grades. Points are dependent on students doing an activity in a window which ends at midnight on sunday each week. The date/time of the activities are stored in the source file in UTC. However, to know if they met the deadline, I need it in local time. I do this by creating a function that translates epoch to a regulate dateTime variable. But I see that when we left daylight savings time, things were thrown off by an hour. The command I use is:
adjust-dateTime-to-timezone((xs:dateTime("1970-01-01T00:00:00-00:00")
- xs:dayTimeDuration(concat("PT", $v, "S"))),xs:dayTimeDuration('-PT4H'))
clearly the problem is the last part -PT4H, because dates that fall after the switch back to standard time from daylight savings time should be -PT5H. Is there a better way of doing this? Is there another command that will give me a localized date that takes into account daylight savings time issues? I tried to set a java calendar but I could not make it work.
Any help would be gratefully appreciated. Thanks in advance Randy
-- Dr. Randall Reed Assistant Professor, Dept. of Philosophy and Religion Appalachian State University _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk