Bug Tracker 
| ID | 95🔗 |
|---|---|
| Date: | 2015-09-14 11:36:21 |
| Status | Closed (Fixed) |
| Category | datetime2 |
| Version | 1.0 |
| Summary | \DTMsaveaszulutime calculates the wrong UTC time |
Sign in to subscribe to notifications about this report.
Description
The\DTMsaveaszulutime command appears to calculate the UTC time incorrectly. The example in the manual illustrates this:
Original date: 2014-05-01 03:55:00-06:00.
UTC+00:00: 2014-04-30 21:55:00Z.
The original date is in the timezone UTC-6, so the corresponding UTC time should be 09:55:00, not 21:55 the previous day.
If I save and print the current time using:
\DTMsavenow{creationDate}
\DTMtozulu{creationDate}{creationDateUTC}
\DTMuse{creationDateUTC}
I am given a UTC time of 18:20. My local time is 17:20 BST (= UTC+1), so the corresponding UTC time should be 16:20, not 18:20. (The minimal working example will only show the improper behaviour if the computer's timezone is not set to UTC.)
As far as I can tell, this can be fixed by changing the line
\edef\@dtm@TZhour{\number#8}% to
\edef\@dtm@TZhour{-\number#8}% in the package's source code.
MWE
Download (230B)
\documentclass{article}
\usepackage[calc]{datetime2}
\begin{document}
\DTMsavenow{creationDate}
\DTMtozulu{creationDate}{creationDateUTC}
Current time: \DTMuse{creationDate}
UTC time: \DTMuse{creationDateUTC}
\end{document}
Evaluation
Fixed in v1.1 2015-09-15.
Comments
0 comments.
Add Comment
Page permalink: https://www.dickimaw-books.com/bugtracker.php?key=95
