LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get India date and time from any website

Hello,

I have to get India time and date in my labview program. This is to compare this standard time with the real time clock of my device and show difference. How do I fetch the current time and date. Should I use a webservice ? How to do this ?

Thanks ..
0 Kudos
Message 1 of 8
(4,939 Views)

You do not need a website for this. First you can get the actual time zone of the PC where your app is running:

http://digital.ni.com/public.nsf/allkb/431FCE1528C66AE086256E7B007919C2

 

India has a time zone of UTC+5:30, so it is simple math to get the actual time in India in your LabVIEW app...

0 Kudos
Message 2 of 8
(4,926 Views)
You can also get your computer's offset from GMT with LabVIEW.

By default, LabVIEW always represents timestamps in local time, however you can force LabVIEW to express a timestamp in GMT. Subtract one from the other and you have the offset in seconds, a couple unit conversions and you have hours.

No API calls required.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 3 of 8
(4,906 Views)

Hello,

 

Thank you.

 

I do not want to read computer's time where my VI is running. The time on the device under test should be compared with standard time. Computer's clock may have it's own drift. So I was thinking of accessing website and reading time. How can I do this.

 

Thanks

0 Kudos
Message 4 of 8
(4,890 Views)

What's "Standard Time?"

 

I guess you could get your time from an NTP server.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 8
(4,881 Views)

Hello,

Is there a program to read from the time from  NTPserver. I saw one VI. I did not get the actual IP address and port number of India NTP server. Please let me know. Thanks

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0 Kudos
Message 6 of 8
(4,878 Views)

@Hemagopal wrote:

Hello,

 

Thank you.

 

I do not want to read computer's time where my VI is running. The time on the device under test should be compared with standard time. Computer's clock may have it's own drift. So I was thinking of accessing website and reading time. How can I do this.

 

Thanks


I do not understand your logic here. You say you do not want to get your computer's time, since it "may have it's own drift". You say you want to get the time on the device under test (any more info about this device?). How could a website give you the "actual time of a device under test"? If your PC's time is properly set, it should be totally enough...

 

Edit: If you wanna go the network way, here is a solution from altenbach:

http://forums.ni.com/t5/LabVIEW/help-with-connecting-to-NIST-NTP-server-on-port-123/m-p/1196853/high...

and a NIST server list:

http://tf.nist.gov/tf-cgi/servers.cgi

0 Kudos
Message 7 of 8
(4,869 Views)
If your computer is configured correctly it will be synchronized to network time. Regardless what you do you aren't going to get accuracy that is much closer than a second without a lot of specialized hardware. How close do your clocks need to be?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 8 of 8
(4,848 Views)