04-10-2019 10:12 AM
Hi,
I'm attempting to use the Scan From String function to read a concatenated string as the time and date.
The concatenated string is in the format of HHMMSSddmmYY, but I have only had luck in outputting as HH:MM so far.
The string syntax I'm using is Time: %<%H:%M:%S%d/%m/%Y>T
04-10-2019 10:22 AM - edited 04-10-2019 10:27 AM
Use %<%H%M%S%d%m%y>T
Your original string doesn't have colons and slashes, so neither should your format string.
Christmas day later this year.
04-11-2019 01:46 AM
04-11-2019 06:52 AM - edited 04-11-2019 06:53 AM
I wanted to pick a date that the user could see that the month/day shown on my timestamp is correct having been reversed from the European day/month. I just picked Christmas, because hey, why not? it is a good day.
I had also been using single digit months and days that would show up as a 04 (for April) in his code to make sure it read them properly
04-11-2019 07:45 AM
Thanks for the speedy response RavensFan!
It's got my date almost spot on, but it appears to be an hour out?
I tried changing the y in the format string syntax to Y which changed it to 12, but then the year when to 1600
The concatenated string in coming from the concatenate string, even though it looks like its coming out of scan from string in the attached picture.
04-11-2019 07:46 AM
Attached picture**
04-11-2019 08:40 AM
It works fine for me.
It is possible your timestamp indicator is set for a different timezone setting than your local timezone? Is your timezone GMT -1:00
Why are you only taking the first 6 characters of your number and concatenating a different string to it? (But that wouldn't affect the results you are seeing.)
04-11-2019 09:06 AM
Strange, what version of Labview are you running?
The time is coming from a NMEA sentence from a GPS, which gives time up to ms. The first 6 characters of the time are taken (HHMMSS) and concatenated to the date from the GPS (DDMMYY), to give the overall time and date.
I'm in BST right now, but the time is reading from the GPS which is UTC (once it finds a fix)
04-11-2019 09:35 AM
I'm using LV 2018, and I'm in Eastern Daylight Time. UTC -04:00 for the summer.
I googled and saw BST means British Summer Time and that it is 1 hour ahead of UTC. So that explains a 1 hour difference, but then again, perhaps it is in the wrong direction.
It would be best if you attached the actual VI so I can see the timestamp display settings and play with it.
04-11-2019 09:36 AM
The scan from string function is *not* "adjusting" your time.
My guess is that your Labview Time Stamp format is wrong.