04-19-2015 07:00 PM
Hi to all,
Is it possible to display a different timezone from your local PC? Ex. My PC is set in Philippines timezone but I want to display US timezone during the query. Hope anyone can answer my question. Thanks in advance.
04-19-2015 07:24 PM
Is this related to LabVIEW?
Can you post a simple VI that shows what code you are working with?
04-19-2015 08:05 PM
Hi,
Yes. This is labview related. What I'm trying to do is to display other timezone without changing my current PC timezone. I can easily display my current timezone and local date/time using the Format Date/Time String but I cannot find a function for displaying other timezone (in this case US timezone).
04-19-2015 08:16 PM
Add or subtract from the timestamp the number of hours different between the two time zones before converting it to a string.
04-19-2015 08:43 PM
@RavensFan wrote:
Add or subtract from the timestamp the number of hours different between the two time zones before converting it to a string.
Of course, RavensFan knows that the TimeStamp is in seconds, so if the difference in time zones is +7 hours, you would add 7*60*60 to the local TimeStamp to get the equivalent TimeStamp in the other Time Zone.
Bob Schor
04-20-2015 12:27 AM
04-20-2015 01:25 AM
Thank you guys, for all of your replies. I was able to figure out the initial problem using the attached code. However, I want my final output to be in military (24-hour) time, same as the input format. Any suggestions?
Thanks again.
04-20-2015 01:45 AM
Hi rctrigger,
wow, a lot of code for a simple add/subtract operation:
You haven't understand that "use a DBL float with unit enabled" thing before?
I want my final output to be in military (24-hour) time
Then you need to use a proper display format or format string. All the formatting options are explained in the help!
04-20-2015 11:21 AM - edited 04-20-2015 11:22 AM
Yeah units are great until they don't work, then they are terrible. You can achive similar results if you change the display format of the double constant and show it as relative time HH: MM: SS then have the constant have a value of 4:00:00, of course with a comment or a label explaining the format. This also allows to mix units in relative time and you can subtrac 4 hours 2 minutes with 4:02:00.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
04-20-2015 11:42 AM
Yes, well time calculations are an area where units work really well. For example, you can easily expand on Gerd's example to add any sort of arbitrary time offset:
Mike...