LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

date 10days missing

Solved!
Go to solution

Hello,

in the attached after convering the date are 10 days missing, but anything else is right. See attached.

Thanks!

Download All
0 Kudos
Message 1 of 9
(2,917 Views)
Solution
Accepted by topic author Steffen01

That is because your formats do not equal at all.

 

1. You Format Date/Time does not have an AM/PM flag, but your Scan From String is expecting one.

2. Your Day and Month got flipped in your Scan From String compared to the Format Date/Time String.  And apparently the month is truncated to 12.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 9
(2,902 Views)

Ah. I knew it was a coincidence that it output something vaguely reasonable, but I couldn't catch the 12 months cap. Doh!


GCentral
0 Kudos
Message 3 of 9
(2,861 Views)

is there an easy way to create these settings. I reordered the values, but that did not work. So I copied something close.

I guess below the surface its still the same representation, one bit for each second since 1904. Thats why it does not mess it up completely.

Its meant to come out as YYYY-dd-MM hh:mm:ss:ms, looks kind of right in MySQL. Except the ms are always .00

0 Kudos
Message 4 of 9
(2,836 Views)

Read

 
It is not 1 "bit" for each second.  The value of 1 is each second.  You can have fractions of seconds also.
 
Here is a fixed version of your VI.
0 Kudos
Message 5 of 9
(2,831 Views)

actually the problem is, the date is limited to 12. Today its still 12, if it was to remove 10 days, would be 13

Maybe I can copy the format string from the advanced properties section in the properties of the indicator

edit: switched %d %m to %m %d, seems to work now

0 Kudos
Message 6 of 9
(2,827 Views)

The problem is you formatted it one way as month then day to go to a string, then then scanned from that string formatted back as day then month.  You went from month 6 day 22, to day 6 month 22.  Since there is no month 22, it became day 6 month 12.

 

That is what Crossrulz was telling you in his post.

 

For timestamp indicators, they take a value of a timestamp.  The way they are displayed are determined by the format in the properties of that indicator.

 

Your %p is in an odd location.  And when you use %p for am/pm, you want to use %I for the hour so it used a 12 hour clock.  %H is for a 24 hour clock.

Message 7 of 9
(2,823 Views)

I cannot even remember why I did it. I think because I wanted the milliseconds to go into SQL

0 Kudos
Message 8 of 9
(2,816 Views)

actually, with wait until next multiple ms, when set to 1000ms at the 1st iteration its at some value. 2nd and further iterations are at 767 ms. If I set the timestamp not as unique value it does not matterten. 1st two rows have the same timestamp but from then on its one every 1s and its not trailing off.

I set another column as auto index, that gets me a running unique number, so I dont rely on time as unique number.

0 Kudos
Message 9 of 9
(2,804 Views)