VI to convert Unix time to standard time?

hi,
I am in need of a VI to convert Unix time to Standard time?
eg: Unix time: 1268845177 in seconds
Standard time: GMT: Wed, 17 Mar 2010 16:59:37 GMT
                        Your timezone(U.S):
Wednesday, March 17, 2010 10:59:37 AM
I have the calculation but not full formula.
Unix time is in seconds from Jan 1,1970, 00:00:00 UTC, starting at 0 counting forward.
When 1268845177/86400 = 14685 days.
86400 = 60*60*24 seconds
But how to convert the 14685 days and relate to the current date, how it should be done?
Either the formula or a VI to convert Unix time to standard time will be a help.
Regards,
Arvinth

Timestamps and the PC clock vs. time on the net are different and I'd say somewhat unrelated concepts.
You are worried about accuracy of the current time.  Timestamps have nothing to do with current time, but are a way of identifying and particular moment in time.
Yes, the PC clock gets its time from the net assuming the time server settings are all set properly.  Even the correction of the current PC time may not happen exactly when the leap second gets inserted.  It may be some time before the PC resynchronizes with the net time.  The PC doesn't know if the existence of when a leap second will occur.  And neither does the LabVIEW timestamp.
Here is an example.  According to http://en.wikipedia.org/wiki/Leap_second, a leap second will occur at the end of June 30 of this year UTC.  Since my clock is eastern daylight time at that date, I put together an example for 8pm on June 30  (UTC +4).  You'll see that the 3 values (a second before, the exact time, and a second after) show they are all 1 second apart.  There is no extra second accounted for.  So in real life the time a second after  vs. a second before are actually 3 seconds apart, but LabVIEW only show 2 seconds.  Feel free to play with the attached snippet for different timezones and daylight savings time and all of that.
I don't think you really have as big of a problem as you are trying to investigate here.  If your timing needs are that critical where you need accuracy of the current time to better than a second, then you shouldn't be looking at LabVIEW timestamps, PC time clock, or internet time at all, but look at a high accuracy timing source perhaps based on a GPS clock.
Unless you have a particular test planned to run over the expected point of time where a leap second is inserted, then you shouldn't have to worry.  Even if you do have a test run over the leap second, you probably don't need to worry either.  If the test is based on a waveform datatype, then you have a T0 timestamp, and a dT that will keep track of all the individual data points accurately.
Attachments:
Example_VI.png ‏20 KB

Similar Messages

  • Unix time to standard time

    hi,
    i am writing a program to convert Unix time in the normal date. I wrote the
    following program. The Input is not converted properly to the normal date.
    It prints date without any issue but the time is not correct. As per the java docs
    about the date constructor the value should be calculated from
    01/01/1970 00:00:00 but mine one by default shows 01/01/1970 07:30:00
    I don't know from where 07:30 is coming by default.
    Looking forward for the suggestions.
    import java.io.*;
    import java.util.*;
    import java.text.*;
        public class unixTime{
            public static void main ( String [] args ) throws IOException
                int dateinsec = 0;
                   long t =  dateinsec * 1000L; 
                   SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
                   Date regDate = null;
                   regDate = new Date(t);
                   System.out.println("Formatted date is: " + formatter.format(regDate));
        }Thanks.
    Corrected thanks
    Edited by: vinee on Oct 7, 2008 2:10 AM

    vinee wrote:
    Sorry i didn't check earlier that i posted at the wrong place.
    Extremely sorry.No worries. Just don't do it again please.
    In the future, if you do post in the wrong place and want to repost the question in the right place, just go back to your original, and provide a reply that says something like "move to" + the URL of your new thread, so there's one coherent discussion and people don't duplicate each others' efforts.

  • Calendar alert times in "standard time"

    So we (mostly) are now on Standard Time. I use Calendar (all day) alerts as a sort of to-do list, the notifications being very handy for this (thank you Apple for fixing some Mavericks calendar weirdness  in Yosemite - my other support question regarding Calendar in Mavericks appears to be fixed in Yosemite).
    However, when I set an alert for a particular time, it indicates that the alert will be one hour later. To be clear, when I look at the "custom" alert time, it is what I set it for - but when I look at the alert time for the event in the event information, it is one hour later. BUT it appears to "notify" at the time I set it to.
    So for example, if in the "alert" setting for the event, if I select "custom" and enter a time - that is the time that the notification occurs. BUT the "alert" line indicates it will occur for a time one hour later. WTHeck?
    Been checking preferences in Calendar and iCloud. Can't seem to fix it. Or am I just misinterpreting it?
    Hope this question makes sense ...

    Uh, this may fall into the Emily Litella Category.
    The all-day events I refer to above were pulled forward across the Standard Time change (in other words, they were created under Daylight Savings Time). Calendar (or me) appeared to be confused by this today (the first day of Standard Time).
    I just pulled them forward again (in other words from one Standard Time day to another) and now Calendar is treating them as it should.
    So hopefully, that will be true tomorrow. "Never mind."

  • Convert Unix timestamp to LabVIEW time

    Hello
    I need to convert a Unix timestamp comming froma dll to a LabVIEW time. Does anybody now some ready to use function for this?
    Thanks
    Solved!
    Go to Solution.

    DAckermann wrote:
    Oh yes. That was easy.
    Thank you very much!
    Exceot that there is a small possible gotcha. If you enter 1/1/1970 in a LabVIEW timestamp control and convert this to a double to get the number of seconds you likely end up with an error of your local timezone offset.
    Both the Unix and LabVIEW epoch are defined respective to GMT which for most practical purposes is the same as UTC. So you have to make sure to get the number of seconds for a timestamp that shows 1/1/1970 00:00 UTC to be right.
    Spoiler (Highlight to read)
    If you ended up with 2082844800 as offset then you got it right.
    If you ended up with 2082844800 as offset then you got it right.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • CONVERT TIME IN HOURS INTO STANDARD TIME.

    Hi All,
              I have time in standard time format for Ex. 07:00:00 . And I want to add 4 hours and 30 min into that time. That means after adding my output I want like this 11:30:00. That means time is now 11 pass 30 min 00 seconds.......Plz tell how to do this............
    Regards.
    Pradip Pawar

    Hi Pradip,
    you can do it by the way Anji told you.
    I didn't try but guess
    what will be the result of '<b>21:00:00</b>' and '<b>04:30:00</b>'  ?
    Declare variable time1 , time2 and time3...
    Time1 = '21:00:00'.
    Time2 = '04:30:00'
    Time3 = Time1 + Time2.
    write /  Time3 USING EDIT MASK'__:__:__'.
    See the output...
    For getting solution of this problem...
    You should convert the time into SECONDS for both time valuse
    Then add those seconds
    Then again convert it into HH:MM:SS...
    Hope it will help you
    Please correct me if i am wrong.
    <b>Reward Points if it is helpful.</b>
    Thanks & Regards
    ilesh 24x7

  • Converting unix data to normal date time.

    Post Author: Keshavan
    CA Forum: Formula
    Hi,
    Can anyone help me out on how to convert the unix date time format to normal date time? I should convert this unix data to proper time format also with GMT+5:30 hrs. Please help me to do the same.
    Thanks in advance,
    Keshavan.

    Post Author: V361
    CA Forum: Formula
    Could you provide some samples, I am not sure what a Unix data time looks like.
    Unix date that displays:
    Date you want to display:

  • Converting UNIX time stamp to local time using T- SQL

    Hi All,
    I am getting DateTime in UTC time (UTC time (Coordinated Universal Time or Greenwich Mean Time))  using (datediff(ss, '1/1/1970', current_timestamp)) . I want to Convert this in my Local DateTime (CST DateTime). How to achieve this in simple way in T-SQL.
    thanks,
    Venkat

    Imports System.Data.SqlTypes
    Imports System
    Imports System.Data
    Imports System.Data.SqlClient
    Imports Microsoft.SqlServer.Server
    Partial Public Class UserDefinedFunctions
        'Microsoft.SqlServer.Server.SqlFunction(IsDeterministic=false)
        <SqlFunction()> _
        Public Shared Function displayLocalTime(dt As SqlDateTime) As SqlDateTime
            If (dt.IsNull) Then
                Return dt
            End If
            Return TimeZone.CurrentTimeZone.ToLocalTime(dt.Value)
        End Function
    End Class
    Apply it to SQL Server and use in SELECT statement
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Name for standard time format?

    Is there an official name that describes the Java standard time representation?
    I think Java standard time defines two important things and I wish I could refer to them with a single, short, accurate name. The two things the standard defines are:
    1) An epoch from which time is measured. The epoch is midnight, Jan 1st, 1970 AD, GMT.
    2) The standard form of expressing time is in milliseconds (not seconds, not days) since the epoch.
    Everytime I write a document telling someone that a time will be or should be expressed in this way, I have to write a description.
    "express time in millis since midnight jan 1st, 1970 AD"
    Is there an official (and much shorter) way of saying the same thing? The UNIX time standard, on which this is based, also seems to not have a name. The POSIX time standard seems to be wrong in that it doesn't handle leap years correctly.
    By contrast, it is easy to find a half-dozen web-sites that can tell you, definitely, what a Julian date is. The Julian date standard defines both an epoch (noon on jan 1st 4713 BC) and a standard way of expressing time as days since the epoch and fractions of days since the epoch.
    Can anyone help me out? Is there an official name? Can we bestow one? Java Standard Time would be fine with me, but it won't work if I'm the only using it.

    I don't think it really needs a name. Within Java we
    can just say time in milliseconds and assume the
    standard origin.Yeah, I agree with you, but I'm not really sure it would help the original poster to just assume that the origin is standard. Have you ever noticed how many people post questions about java.util.Date that are caused by a total inablity to understand that the class is nothing more then a wrapper for a time elapse ('how do I swtich the month to Januaray, why is the system time a huge number')? People new to programming seem to have a hard time understand dates as a distance from some origin in time, rather then a calendar expression, and Sun compounded the problem by including those deprecated calendar-specific methods in the original API (creating the impression that it is a calendar class). I don't think any one but senior level programmers will be able to sense the implied origin, even though your point that all computer dates use that epoch as a standard origin is correct.

  • How to make the iCal in iPad to convert the received events in the proper time according the time zone of the device

    Heya.
    I have the next event:
    BEGIN:VCALENDAR
    VERSION:2.0
    METHOD:PUBLISH
    PRODID:someId
    BEGIN:VTIMEZONE
    TZID:Central Europe Standard Time
    BEGIN:STANDARD
    DTSTART:20111002T030000
    RRULE:FREQ=YEARLY;BYDAY=-1SU;BYHOUR=3;BYMINUTE=0;BYMONTH=10
    TZNAME:Central Europe Standard Time
    TZOFFSETFROM:+0200
    TZOFFSETTO:+0100
    END:STANDARD
    BEGIN:DAYLIGHT
    DTSTART:20110301T020000
    RRULE:FREQ=YEARLY;BYDAY=-1SU;BYHOUR=2;BYMINUTE=0;BYMONTH=3
    TZNAME:Central Europe Daylight Time
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0200
    END:DAYLIGHT
    END:VTIMEZONE
    BEGIN:VEVENT
    DESCRIPTION:Some Description
    DTEND;TZID=Central Europe Standard Time:20120919T163000
    DTSTAMP:20120913T082257Z
    DTSTART;TZID=Central Europe Standard Time:20120919T160000
    LOCATION:Some Location
    SEQUENCE:0
    SUMMARY:Some Summary
    UID:1cf04d1c-2b5c-474c-86f4-108101da9b7a
    END:VEVENT
    END:VCALENDAR
    I am in another timezone - GMT + 2.
    When I am adding the event to outlook in win7 - it is converted to my local time = from 17 to 17:30.
    When I am adding it to a friend's Mac - it is converted to his local time.
    When I am trying to add it in a Ipad which is set to the same timezone - GMT + 2, and with timezone support on, it is not converted but set to 16 - 16:30 and the timezone for the event is put to floating, so what to change in the setup of the event to recognize it and converted to the right time or maybe I should change something in the iPad.
    Thanks in advance

    Bilalus,
    Queues are only good to transfer data if your application isn't deterministic. Since you are using Real Time, I am assuming that your application requires determinism. If you are using Timed Loops and you use queues to transfer data between your loops, you are losing determinism. In this case, you need to use the RT FIFO functions. 
    Warm Regards,
    William Fernandez
    Applications Engineering
    National Instruments

  • UNIX time to Oracle time

    Hallo,
    I am acquiring the data for my reports in a UNIX evironment using embedded SQL.
    Therefore I am searching for a function that converts the UNIX time to ORACLE time. Currently I am doing the conversion via a string representation but I would prefer a function that does it on a binary level.
    Thanks a lot - Ulrich

    maybe (using the link provided) ;)
    select case when :unixts between -2114380800 and 2145916799
                then TO_DATE('19700101000000','YYYYMMDDHH24MISS') + NUMTODSINTERVAL(:unixts,'SECOND')
           end the_date
      from dualRegards
    Etbin

  • How can I convert multiple files at one time and not one at a time

    How can I convert multiple files at one time and not one at a time

    Hi Plissey1950,
    Sorry for the lengthy delay to a response.  Are you trying to convert multiple files to individual PDF files at the same time? (not combine them).  If so, you'll need to use Adobe Acrobat for this function. The CreatePDF service does not have the ability to convert multiple files to multiple individual PDF files.
    Thanks,
    David

  • How can I make a pdf book with "camera to pdf" option on phone? I can only convert one pic at a time

    How can I make a pdf book (single pdf file with several pages)  with "camera to pdf" option on phone? I can only convert one pic at a time. ( Or )how can I attach all those pictures converted pdf's into one pdf file which obviously results in to a single pdf file with several pages in it ?

    Adobe Reader on the iPhone is a PDF reading app. It's not a creation app.
    You need to get an app like Pages which is intended for page layout. It can place pictures from the phone and export PDF.

  • Ical all day events show over 2 days during standard time (Nov-Apr)

    Any all day event (either a holiday or an event I have repeating every year like a birthday) I have on my calender during standard time (from November to April) shows over a two day period.
    For example, Christmas Eve shows up on Dec. 23 and 24.
    I have tried syncing with time zone support on and off. I have tried using the same time zone in a different hemisphere. I had this problem last year and again this year. Once we switch to daylight savings the event show correctly.
    Any suggestions?

    Thanks for the link--seems I'll just have to deal with the Palm/iCal calendaring anomalies. Do these "representation disconnects" have anything to do with the weird behavior of my iCal calendars, now that I've synced my palm data to iCal? Immediately after the original Palm/iCal sync, the calendars came up in iCal with no problem. Once I quit iCal, however, and then re-opened it, the list of calendars had disappeared from the "Calendars" pane to the left of the grid, and all of the events had disappeared as well.
    As someone reported elsewhere in this forum, changing the viewing mode (day, week or month) causes the events themselves to reappear, but the "Calendars" pane remains blank.
    I had hoped to ditch palm desktop and streamline my calendar /contact--computer/iPhone syncing, but iCal's odd behavior is making me question whether or not it is stable enough to fully rely on.
    Is there anything that will make the calendars and events perform more reliably?
    G5-Dual 2.5 GHz Mac OS X (10.4.10)

  • Ical invites seen off by 1 hour in Outlook for IST (India Standard Time)

    Hi,
    I have this strange problem since I migrated to MAC recently and started using iCal.  Earlier I was using Thunderbird with Lightning.  I am in the India time zone (IST).  Whenever I create an appointment using iCal and send invites (using MAC Mail) to meeting participants, the Outlook users among the recipients see the meeting at a time that is an hour ahead of the scheduled time. Lightning users get the invite correctly.  Both my Mac and the recipients are using IST timezone.
    Please note that India does not use daylight saving.  I dug into the problem a bit and I have a speculation about what is going wrong.
    India used daylight saving briefly in 1942.  The VTIMEZONE specification generated in the ics by iCal seems to specify that daylight savings is used since May 15, 1942, and standard time is used since Sep 1, 1942.  My speculation is that Outlook interprets this as saying that daylight saving is in force today (July 2013), probably just ignoring the year specification.  Other calendar applications possibly are unaware of this bit of world war II history.
    Any way that I can get iCal to not include the timezone information or to modify its 1942 memory?  Currently, I am creating all appointments using UTC but that's obviously not pleasant.
    Here is a paste of the relevant data in the ics file.
    BEGIN:VTIMEZONE
    TZID:Asia/Kolkata
    BEGIN:STANDARD
    TZOFFSETFROM:+0630
    DTSTART:19420515T000000
    TZNAME:GMT+05:30
    TZOFFSETTO:+0530
    RDATE:19420515T000000
    RDATE:19451015T000000
    END:STANDARD
    BEGIN:DAYLIGHT
    TZOFFSETFROM:+0530
    DTSTART:19420901T000000
    TZNAME:GMT+05:30
    TZOFFSETTO:+0630
    RDATE:19420901T000000
    END:DAYLIGHT
    END:VTIMEZONE

    Hi, any thoughts here?  I tried replacing the system timezone file for IST with a vanilla +0530 GMT offset one (in /var/share/zoneinfo) but that didn't work (even after a reboot).  Does Mail (and other such applications) not use the system timezone definition files?

  • Switch to standard time from daylight saving causes error - iOS 7

    Hi there,
    Today (27-Oct-2013) the time was switched back from daylight saving to standard. When looking my iPhone, I noticed that although the clock correctly displays the current time, the standard weather app still uses the time according to daylight saving (i.e. showing one hour ahead) and what is more interesting, the calendar acts weirdly, showing the correct time, but placing it in the old daylight saving time, i.e. 7:46 AM is shown as a line between 8:00 AM and 9:00 AM! It is really ridiculous and it seems I cannot change these. I restarted my iphone, turned off and on again using carrier provided time, but nothing changed. Any clues?
    Using iPhone 5 and iOS 7.0.2.
    Any help is appreciated.

    Problems with time, time zones have been quite common. Clearly, my brand new, the most forward thinking smartphone has the same bug. Sometimes I wonder why Apple is unable to get basic things work? they simply don't care, that's all.
    Issue with the line materializes itself on my iCal on iMac as well
    I hope, at least alarm will go off at the right time Monday morning
    BTW:  last year when I was on trip to Chile, at one night - suddenly - out of the blue - time changed on all our apple devices.. it's bad when you've got your flight next day and don't know when to wake up weeks later I have found out information Apple did not update their list of timezone changing dates.. for couple of years...

Maybe you are looking for

  • Error Message from RMAN after backup

    Hello, I get this message when i try to backup a imported database: RMAN-00571: ================================================== ========= RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================

  • Setting NI5641R ADC input level

    Hi, I am using a NI5641R board and I am programming it using the LabVIEW FPGA Module. How can I set the maximum input level of the ADCs? Concerning the DACs, there is a VI to set the maximum output level in the library that comes with the board. Isn'

  • Function not found though it is defined

    Hi All, Please reply to query 1 from : http://forums.sun.com/thread.jspa?threadID=5410930&tstart=0 Its a earnest request since I am not able to figure out the issue

  • Report related to commission

    Hi sdn's Hi this is related to commission report my client was expecting the condition values which is related commission that values picked up from  the invoice so how i can retrive the data from invoce to commission report ? please suggest me. Than

  • How do i change an indicator's background color

    Hi, I want to change the background color of an indicator. (Yellow in attached image).  I would like to know, which property node controls this value so that I can wire a color box to it. thanks, jason Solved! Go to Solution.