Timezone offset for dst in LabVIEW 8.5

I think there is a "bug" in LabVIEW 8.5.1 and probably 8.5 too. I used to have an application that was transmitting timestamp data between computers in some sort of HTTP protocol. The server application has been build in LabVIEW 7.1 and remains in that version for various reasons.
Now the timestamps are transmitted as UTC formatted strings according to RFC1123. In order to do that I used an old function developed in LabVIEW 6.x or so that calculates the current timezone offset from a timestamp value of 86400 seconds (eg. Jan 2, 1904, 12:00:00 AM GMT). Turning that into a date time rec I observed the actual day, hours and minutes to calculate the timezone offset.
With LabVIEW 7.1 the timestamps in LabVIEW started to use the actual timezone offset valid for the timestamp except if that timestamp was earlier than 1970 in which case it still used the current timezone offset as it did before.
LabVIEW 8.5(.1) apparently changed that behaviour to always use the timezone offset of the actual timestamp and since 2 Jan 1904 was probably in every country (at least on the northern hemisphere) non-DST it now gives a different timezone offset than it used to do since the beginning of LabVIEW 2.5. This is cause me an hour or two of debugging :-(.
Of course the new >= 8.0 solution to calculate the timezone offset is now to convert a current timestamp into a non-UTC date time rec and convert that date time rec back into a timestamp telling it that it is a UTC record and then subtract the original timestamp from that.
I would expect the Internet Toolkit to have that same problem unless it has been adapted for LabVIEW 8.5, since my original routine was at some point "loaned" from that toolkit.
Rolf Kalbermatter                            
Message Edited by rolfk on 06-13-2008 02:59 PM
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions

jimfoxy wrote:
I had a similar problem. I thought it was an intentional feature.
I frequently work with GMT date & timestamped data as an int/double number of seconds or hours. Is there a sensible philosophy of displaying such data on a graph (with X-axis selected as 'Absolute time') without having to first convert the times into system timezone-dependent numbers? What I am doing at the moment is reading the GMT data in, converting it into timezone dependent values to display and manipulate (by applying the method above), then converting the results back again in order to output correct GMT to various files.
I always find it hard to work with time in Labview because you need to keep a close eye on local system timezone settings, unless you ensure that you set the PC's clock to GMT non-daylight savings (not an option for me). It is great that there is now an on/off UTC option for some of the time related VIs.
I don't want to mess around with timestamp datatype because I need to perform manipulation such as division and can't get that to work with timestamps.
It is not a LabVIEW problem really but simply a problem of any application running on a localized date/time system. And since time in any other form than SI normalized is a ratherbeasty thing, it gets troublesome to deal with it in software.
Rolf Kalbermatter
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions

Similar Messages

  • How to find tz offset for a particular day (not today)

    I have DATE values that need to be adjusted based on the tz and dst offset in effect on the date. I'm trying to figure out how to calculate the value to adjust them by.
    tz_offset(tz) returns the timezone offset for the given tz for today. Is there a way to determine the offset for a timezone for another day, so that daylight savings time differences are honored?

    Just double checked an alternative method, once your data is a timestamp with timezone, you can use the extract function to get just the parts of it you are interested in e.g.
    with sample_data as (select TO_TIMESTAMP_TZ('2007/05/10:06:00:00pm', 'RRRR/MM/DD:HH:MI:SSpm') ts from dual
      union all select TO_TIMESTAMP_TZ('2009/02/22:05:00:00pm', 'RRRR/MM/DD:HH:MI:SSpm') from dual
         , to_char(ts, 'tzh:tzm') x
         , ts
      from sample_data
    TZ         TZH                    TZM                    X      TS           
    PDT        -7                     0                      -07:00 10-MAY-07 PM AMERICA/LOS_ANGELES
    PST        -8                     0                      -08:00 22-FEB-09 PM AMERICA/LOS_ANGELES
    2 rows selected

  • Calculate local time based on timezone offset

    I am sure this question has been answered many times. but if you can explain me how to calculate local time based on the timezone offset.
    for instance, I am in central time zone. but i want to display local pacific time on my page. I have the timezone offset as -420 minutes.
    Thanks in advance.

    given a database table tzdata composed of time zone names and tz offset
    i want to be able to display the corresponding Date / Time of each country
    based on the time zone offset .
    in the offsets i posted above i found things like +10.5 ,-1.2 ect..
    how to convert those into the correct format so i can feed it to SimpleTimeZone() construtor ?Why would you want to?
    I am just pointing out here that java already has all those timezones and offsets configured into it. As well as if/when DST applies.
    String[] zones = TimeZone.getAvailableIDs();
            for (int i=0; i<zones.length; i++){
              System.out.println("Zone " + i + " = " + zones[i] + " offset = " + TimeZone.getTimeZone(zones).getRawOffset());
    In other words this database table is reinventing the wheel.
    You just need to tell Java which Timezone you want (according to the standard names for timezones begin Region/City) and it will work out the correct offset.
    for Afghanistan: new TimeZone("Asia/Kabul");
    Albania: new TimeZone("Europe/Tirane");

  • Find UTC offset for pacific timezone

    I have two file names,
    The file name contains the date the file was created on the server.  The server time is Pacific Time, either PST or PDT.  In this example, the first is in PST and the second is in PDT.
    I need a vi to convert the time to UTC according to the timezone rules for Pacific Time, and then display the time using the local time of the computer (regarless of its timezone).  You can see in the vi how I do this manually in the attached vi. Is there a way to use the various date/time functions to figure out whether the offset should be 7 or 8 based on the name/time?
    time.vi ‏15 KB

    OK, I was misunderstanding your request.
    Do the file go back before the last change in Daylight Savings Time dates (2007)?
    If not, here's the limits:
    Effective in the US in 2007 as a result of the Energy Policy Act of 2005, the
    local time changes from PST to PDT at 02:00 LST to 03:00 LDT are on the
    second Sunday in March and the time returns at 02:00 LDT to 01:00 LST on
    the first Sunday in November.
    There is not a simple way to make this automated and flexible to the PC's local time.
    However, you can determine the initial time zone with fairly simple, but not quick to write, code. 1) Find the year of the fileand create complete timestamp
    2) Find the date for the Sundays and create timestamps
    3) Compare timestamps to determine if PST or PDT
    4) Adjust file timestamp to UTC (subtract 7 or 8 hours)
    5) Convert back to PCs local time
    However, if you have any control over the file naming, save as UTC in filename.
    Then all this effort is unnecessary and the code in LabVIEW is simple.
    I attached an example that shows how simple this would be with UTC in the filename.
    In addition, I placed an extra TimeZones control that might be handy as a reference.
    Good Luck,
    time UTC.vi ‏13 KB

  • DST timezone patch for on Linux

    I succesfully downloaded & run a new version of the script utltzuv2.sql which checks your TSTZ current data for any rows affected by the updates to the time zone files.
    (Patch 5126270
    I added manually lines to the timezdif.csv file (at the beginning) which is located in the $ORACLE_HOME/oracore/zoneinfo directory.
    3, America/Denver,2007,
    3, America/Shiprock,2007,
    3, US/MOUNTAIN,2007,
    3, CST,2007,
    SQL> connect / as sysdba
    SQL> @?/rdbms/admin/utltzuv2
    SQL> select * from sys.sys_tzuv2_temptab;
    no rows selected
    I Downloaded and apply the DST timezone patch for on Linux.
    Patch 4689959
    SQL> select case to_number(to_char(to_timestamp_tz
    2 ('20070311 00:00:00 US/EASTERN','YYYYMMDD HH24:MI:SS TZR')
    + to_dsinterval('0 08:00:00'),'HH24'))
    when 8 then 'The patch has not been applied'
    when 9 then 'The patch has been applied correctly'
    else 'Error' end "TZTEST (RUN FROM DB HOME)"
    from dual;
    The patch has been applied correctly
    I applied apply the DST JVM patch successfully. (5075511)
    But I am getting value (0) as below:
    select get_dst_offset('America/Los_Angeles', 2007, 3, 11, 10, 0, 0)/(60*60*1000) as OFFSET_FROM_STANDARD_TIME from dual;
    It should be 1.
    (per Note 414309.1 - USA 2007 DST Changes: Frequently Asked Questions and Problems for Oracle JVM
    Patches - #6. How can I test if the OJVM patch has been applied correctly?

    I reloeded java as "create or replace java system" and its work.

  • Timezone Offset to timezone conversion

    Hi ,
    I have timezone offset +6:00 which is coming from xml.
    how to get time zone from it.

    This looks very wrong. Java Date objects ALWAYS store the date as the number of milliseconds since 1st Jan 1970 UTC. They have no timezone component other than that implied by the UTC.
    Your method public static Date toGMTDate(Date date1, TimeZone tz1)implies that you can create a Date with a Timezone other than UTC. You can't.
    The only time a Timezone is involved is when you convert the Date to a String for display and then the Timezone is that specified in SimpleDateFormat or the local timezone if one is not not specified.

  • Finding out timezone from TimeZone offset

    I'm using JavaScript to find out the local time on client, setting it to a cookie.
    I then retrieve the value in a JSP page to find out the correction necessary for adjusting the time (in UTC) to local time. The problem, however, is that JavaScript returns the Daylight Savings Offset and the Zone_offset as one total, making it impossible to find out what TimeZone this Offset maps to.
    My utility class is using the myCalendarObj.setTimeZone (tz) to adjust the time stamp.
    Any suggestions on how I could find out what TimeZone my offset maps to, or any other suggestion??

    And what to do with problem of Daylight Saving Time? Not all countries use it. For instance, try to get all TimeZone IDs for GMT +00:00...
    For this moment, I see only 2 solution: write a little applet, that will be detect TimeZone of client or lets user to detect his location (like in "Settings" for this page - top right corner). But it's bad solutions.

  • LR4 save to xmp has the wrong timezone adjustment for xmp:MetadataDate

    After installing LR4 and converting a catalogue, I saved the metadata for an image in LR4 and did the same for the same image in LR3.6 (on a different machine).
    The value for xmp:MetadataDate written by LR4 seems to be wrong. My timezone is UTC+8h for Western Australia.  Here is an extract from the xmp file written by LR4:
    Note the MetadataDate is my local time + 8h  (I saved just after 8am).  The timezone offset should be -8h.
    On my laptop, I repeated this with LR3.6 and the ame extract from the xmp file it wrote is:
    LR3.6 adjusts both the ModifyDate and the MetadataDate by -8h, which is correct if the time is meant to be UTC.
    Why LR3.6 has changed the ModifyDate to the time that the xmp file was written, I'm not sure - LR$ doesn't and I wouldn't expect it to either since the raw file (NEF in my case) isn't modified.
    Looks like a bug in LR4 regarding the MetadataDate written to the xmp file.

    I'm confused -- you say "my timezone is UTC+8h for Western Australia".  That is, if it's 13:00 local time in London, it is 21:00 local time in Western Australia. 
    Thus, 08:00 local time in Western Australia should appear in the XMP timestamp as 08:00:00+08:00.  (That's how the timestamps are defined.)  So it sure seems to me that LR 4 is doing the right thing.
    LR 3.5 had a bug in which the signs in the XMP:MetadataData fields got reversed:
    Though LR 3.6 claimed to have fixed that bug, I didn't verify, and I don't see anyone else who verified.   

  • GregorianCalendar with local timezone but no DST

    I need to use the local time but I don't want to use the Daylight Savings Time (DST) rule
    GregorianCalendar oTime = new GregorianCalendar( nFromYear, nFromMonth, nCol );
    oTime.set( Calendar.DST_OFFSET, 0 );
    oTime.clear( Calendar.HOUR );
    oTime.clear( Calendar.MINUTE );
    oTime.clear( Calendar.SECOND );
    oTime.clear( Calendar.MILLISECOND );
    oTime.add( Calendar.MINUTE, nRow * 15 );
    This code still calculates DST.
    Is there a way to use the local timezone but disable the DST???
    There must be.
    I've try useing the SimpleTimeZone object and setting setDSTSavings(int millisSavedDuringDST) to 0
    This only gave me an error.
    If there is anyone who know the proper way to do this your help would be welcomed.
    Thank you.
    nRow = 7
    Creating new calendar with ( nFromYear= 2002, nFromMonth= 3, day= 7,0,0,0)
    Adding minutes 105
    oCurTime= Apr 7, 2002 1:45:00 AM
    nFrom= 1 should be 0 or 1 (-1 Less; 0 Equal; 1 greater )
    nTo = -1 should be -1 or 0
    1 FromTime : 2 oTime : 3 oToTime
    Apr 7, 2002 12:00:00 AM
    04-07-2002 1:45:00
    Apr 7, 2002 11:59:00 PM
    bSel = true
    oHT.put( new Integer( 707), true )
    nRow = 8
    Creating new calendar with ( nFromYear= 2002, nFromMonth= 3, day= 7,0,0,0)
    Adding minutes 120
    oCurTime= Apr 7, 2002 3:00:00 AM
    nFrom= 1 should be 0 or 1 (-1 Less; 0 Equal; 1 greater )
    nTo = -1 should be -1 or 0
    1 FromTime : 2 oTime : 3 oToTime
    Apr 7, 2002 12:00:00 AM
    04-07-2002 3:00:00
    Apr 7, 2002 11:59:00 PM
    bSel = true
    oHT.put( new Integer( 807), true )

    snip form API
    For a time zone that does not use daylight saving time, do not use this constructor; instead you should use SimpleTimeZone(rawOffset, ID).
    This doesn't seem to work either.
    It's still adjusting for DST
    GregorianCalendar oTime = new GregorianCalendar( nFromYear, nFromMonth, nCol );
    java.util.SimpleTimeZone oTZwithNoDST = new java.util.SimpleTimeZone(oTime.getTimeZone().getRawOffset(), oTime.getTimeZone().getID() );
    oTime.setTimeZone( oTZwithNoDST );
    oTime.clear( Calendar.HOUR );
    oTime.clear( Calendar.MINUTE );
    oTime.clear( Calendar.SECOND );
    oTime.clear( Calendar.MILLISECOND );
    oTime.add( Calendar.MINUTE, nRow * 15 );
    nRow = 7
    Creating new calendar with ( nFromYear= 2002, nFromMonth= 3, day= 7,0,0,0)
    Adding minutes 105
    oCurTime= Apr 7, 2002 1:45:00 AM
    nFrom= 1 should be 0 or 1 (-1 Less; 0 Equal; 1 greater )
    nTo = -1 should be -1 or 0
    1 FromTime : 2 oTime : 3 oToTime
    Apr 7, 2002 12:00:00 AM
    04-07-2002 1:45:00
    Apr 7, 2002 11:59:00 PM
    bSel = true
    oHT.put( new Integer( 707), true )
    nRow = 8
    Creating new calendar with ( nFromYear= 2002, nFromMonth= 3, day= 7,0,0,0)
    Adding minutes 120
    oCurTime= Apr 7, 2002 3:00:00 AM
    nFrom= 1 should be 0 or 1 (-1 Less; 0 Equal; 1 greater )
    nTo = -1 should be -1 or 0
    1 FromTime : 2 oTime : 3 oToTime
    Apr 7, 2002 12:00:00 AM
    04-07-2002 3:00:00
    Apr 7, 2002 11:59:00 PM
    bSel = true
    oHT.put( new Integer( 807), true )

  • Problem with variable offset for 0CALMONTH

    Hello Community,
    I have a problem with using variables offset for time characteristic 0CALMONTH
    Let's say my current query looks like this:
    ...................01.2006..........02.2006..........03.2006   (0CALMONTH)
    Sales ..............100..................125................200   (Keyfigure)
    What I want do now is to add a previous year comparison. So that it should look this way:
    ...................01.2006..........02.2006..........03.2006   (0CALMONTH)
    Sales ..............100..................125................200   (selected months)
    LY_Sales...........50..................100................100   (selected months - 12)
    (LY_Sales should show figures of 01.2005, 02.2005 and 03.2006 in this example)
    I used new selection for LY_Sales with variable offset for 0CALMONTH -12 but that didn't work. Figures in second line are zero. The desired figures would show up (if I expand the selected time intervall wide enough) in 01.2005, 02.2005 and 03.2005 but that's of course not what I want.
    Please help if you can!

    We can get an an other way by using CELL editor caoncept.
    First create teh query like this:
    ...................01.2006..........02.2006........12.2006.....01.2005...02.20005...12.2005  Sales ..............100................125..............200.............50...........100.........100 
    Sales ..............100................125..............200.............50...........100.........100
    Then hide the 2005 years' kf:
      Sales ..............100................125..............200 
    Sales ..............100................125..............200
    Though the call editor concept overwrite the second rows(selection) content with hidden columns of second row(selection) one by one .i.e first cell of 2nd row will be overwritten by 13 th cell of second column.similarly second cell of 2nd row will be overwritten by 14 th cell of second column........
    First row(selection) : Cal year Charactertic with restriction 2006.
    second row(selection) : Cal year Charactertic with restriction 2005.
    With rgds,
    Anil Kumar Sharma .P

  • How to create offset for calendar year/month in BEx Reporting

    HI ALL,
        i have a requirement of creating offset for calendar year/month.Basically i have a characteristic in Rows and volume key figure in Column and i have to put that volume under the calender year /month which is shown below ..
                             Previous Volume           Present Volume
                                     01.2010                             01.2011
    material                    10000                               20000
    how can i create a report for this . by using volume key figure i am creating previous volume and present volume,. how can i put them in key figure do i have to create any structure, selections  for that.... and "" how can i get the present year volume and previous year volume. If i use cal year/month how can i create offset for that.....
    please do let me know in brief...
    Thank you.

    Hi ,
    I think you need data year wise .
    Instead of creating a variable for calmonth and using it in the RKF , you can just drag calyear in columns and keep the Volume keyfigure below it . Keep only one keyfigure Volume and do not restrict it with calmonth or any other variable .
    In this case calyear should not be present in rows or free characteristics .
    You would be able to see the data year wise ..
    Try this and check whether it is according to your requirement
    If You need to show the data as Volume (01.2011)  and Volume(01.2010)
    It means you are only showing data for Jan 2011 and Jan 2010 in the report
    In this case you can retrict Volume keyfigure with a variable and create a customer exit variable
    for 0calmonth as an offset of -1 will bring the data of 12.2010 for Previous Volume(01.2010) key figure which is incorrect .
    For your output you can create 2 customer exit variables :
    One will restrict 0calmonth to current year and another to previous year .
    Check whether this works .
    Also , if you want to show current calendar months data , you can either use a mandatory variable on 0calmonth
    and restrict the same in volume keyfigure or there are std customer exit variable provided by SAP to give current cal month .
    You can restrict the char 0calmonth with this std exit variable if you do not want 0calmonth variable to be mandatory.

  • Variable Offset for Customer Exit??

    is it possible to have a variable offset for customer exit time variables?
    E.g. I have a variable current month but can I also create a one-year offset of that?
    In our system that doesn't work (but also the current month variable doesn't work...)

    As it is mentioned by Mr.Voodi,it definately works.
    You only has given the answer for your problem .i.e you need to make sure the Customer exit variable is working proper.So take a look on the code used for it.
    With rgds,
    Anil Kumar Sharma .P

  • Offset for variable not working !

    I have to show sales for last 5 months ( in 5 diff. Columns )
    So, i have written CMOD code, where i am converting System date in to Fiscal Year / Period using FM DATE_TO_PERIOD_CONVERT.
    every thing works good, i do get result. but the problem is the Offset for Variable function doesnt support that.
    I was hoping that, Now i can do Offset -1, -2 , -3...till -5 and i will have all 5 Periods.
    But looks like its not working out.
    What other logic i can use.
    !!!!!!!!!!My Variable is Not ready for Input !!!!!!!!!!! So the only way i found is to convert system date to current Period and then off setting it till last 5 months. And i do need to so last 5 months starting current Period -1, -2, -3, -4 and -5
    is there any other way to get current Period ( i guess only from system date ).
    I think in my logic, when i do offset, its not offsetting the Period, but its off setting system date.
    Please help

    Hi Honar,
    I am pretty sure offset should work, in your customer exit, calculate the current period as using the system date, once you get that, create a variable with the same name as you defined in the customer exit and use that variable in five different restricted key figures with each with (Variable, Variable -1, Variable -2, Variable - 3 and Variable - 4). If you have done so and not working, what are you getting in each of the variables, there might be some notes which could address that issue.

  • Java update for DST for version 1.4.2

    Hi all I have Java Runtime Version 1.4.2 installed on Windows 2003 standard editon server no service pack. We need to update Java for DST because we have applications that need it. I thought I had downloaded the proper update from the download page . I downloaded
    1.4.1_13, however I uninstalled version 1.4.2 first I don't think that was correct. Do I need to use the tzupdater tool to update version 1.4.2 or is the 1.4.2_13 version oK or should it be installed over top of 1.4.2?? any help would be greatly appreciated.

    Any 1.4.2 version should be OK, particularly 1.4.2_13. Just install it to it's own directory (I believe the installer will do this anyway) No need to remove earlier versions, unless you want to.
    Edit: jre 1.4.2_11 or later has the correct DST rules

  • STZBC table need to be updated correctly for DST Brazil Change.

    Hi All,
                          STZBC table need to be updated correctly for DST Brazil Change.
    I see two options to change it:
    1) Create a new line for 2009 in STZBC -> Variable time zone rule in DT1 and create the transport
    2) Apply SAP Note 198411 (attached) in DT1 and create the transport
    I have have concern for daylight saving as according to Note 1251372 there is no standard daylight saving time in brazil .
    this note mention daylight saving for  2008/2009 (i,e daylight saving time in Brazil begins on October 19, 2008 and ends on February 15, 2009.) and this note is the latest note available.
    what would be daylight saving time in brazil for year 2009/2010? should i need to raise message to SAP asking for any new note applicable to daylight saving?
    Thanks for your help in advance.


Maybe you are looking for