- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Task: create time stamps to check times series data (10-minute data, one year) in an ASCII-file
To check data, I use UNPACKTIMEQQ to create continous time stamps to compare to a file with measurment data (time series with 10 minute steps) and I reversly use PACKTIMEQQ.
UNPACKTIMEQQ creates this time series, but unfortunately it does not neglect day light changing. It switches to summer time in March and back to winter time in autumn. This makes it difficult to use for measurement data, which consequently stick to UTC.
UNPACKTIMEQQ and PACKTIMEQQ are easy to use routines. Are there alterntative routine without the day light saving restriction, easy to use?
Thanks
Example of daylight saving shift at 2h:
...
25.03.2012 00:00:00
25.03.2012 00:10:00
25.03.2012 00:20:00
25.03.2012 00:30:00
25.03.2012 00:40:00
25.03.2012 00:50:00
25.03.2012 01:00:00
25.03.2012 01:10:00
25.03.2012 01:20:00
25.03.2012 01:30:00
25.03.2012 01:40:00
25.03.2012 01:50:00
25.03.2012 03:00:00
25.03.2012 03:10:00
25.03.2012 03:20:00
25.03.2012 03:30:00
25.03.2012 03:40:00
25.03.2012 03:50:00
25.03.2012 04:00:00
25.03.2012 04:10:00
....
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[fortran]program showgmt use ifport character (len=8) locdate character (len=10) loctime character (len=5) loczone character (len=10) gmtim integer ltim(8) ! ! First method: use Fortran date_and_time ! call date_and_time(locdate,loctime,loczone,ltim) ! adjust for time zone to get UTC imin=ltim(5)*60+ltim(6)-ltim(4) if(imin < 0)then imin=imin+24*60 else if(imin > 24*60)then imin=imin-24*60 endif write(*,10)imin/60,mod(imin,60),ltim(7) ! ! Second method: use C routine gmtime() ! call cgmtime(gmtim) write(*,*)gmtim 10 format(1x,2(I2,':'),I2) end program showgmt [/fortran] Here is the interface between Fortran and C (you could redo this using the Fortran 2000 C-Interops).
[cpp]#include
[bash] 4:28: 8 4:28: 8 [/bash] You may want to replace blanks in the output by zeros if you prefer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
change "I2" to "I2.2" to get the leading zeros.
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, and in the C routine, change "%2d" to "%02d".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The GMTIME routine (also in Fortran) helps, even so it is a little less comfortable than UNPACKTIMEQQ. But in addition I need the reverse routine (like PACKTIMEQQ) to convert time into unix-format. In the Web I could not find a combination like PACKTIMEQQ and UNPACKTIMEQQ, converting and reconverting to/from the same (unix) format.
PACKTIMEQQ and UNPACKTIMEQQ would be perfect for my purpose, if they would omit time changes due to day-light saving.
By the way, I am not interested in dealing with real time data, it's all about "historical" data.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page