Certification

cancel
Showing results for 
Search instead for 
Did you mean: 

CLD 7 prep material

Solved!
Go to solution

Hello,

 

I have some problem with the CLD 7, time/date parsing into strings exercise.

I have tested this on two laptops, one is with Win7 x64, UK English, the other Win7 x64 Hungarian language.

On both laptops, if I run the following snippet:

 

date_snippet1.png

 

I do not get Week-day info in the string, as in the CLD7 exercise they show. In US English windows, does it provide week day I guess...? Why I do not get weekday info as described in this excercise?

CLD7 pdf is attached.

 

edit: in the pdf they mention this deviation from EU, but instead of giving a proper example in the solution VI, they just fake a string in the case 🙂 So how can I quickly get day name if my laptop does not live in the Wild West? 🙂

 

EDIT: I tested this, and if I change the language to US English in the Windows 7 settings: "regio and format", the above snippet does give week day! 🙂 Actually also if it set to German 😄 But UK English misses this feature...

 

US:      Friday, November 14, 2014

HUN:    2014. november 14.

UK:      14 November 2014

GER:    Freitag, 14. November 2014

 

EDIT2: I will ask the NI guys at Munchen about the LabView version and the language settings of the OS, so what system they will give me for the exam. I only specified that I take the exam in English with English LabView...

 

 

0 Kudos
Message 1 of 10
(7,222 Views)
Solution
Accepted by Blokk

That function uses local settings.  That could be a problem for some people.  I would recommend using the Format Data/Time String instead.  With that function, you specify exactly what you want to see using % codes.


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
Message 2 of 10
(7,207 Views)

thanks, I will use it. I guess there is a % code for week days too, I will check the LV help!

regards,

0 Kudos
Message 3 of 10
(7,204 Views)
Solution
Accepted by Blokk

%a is the abbreviated weekday name and %A is the full weekday name.


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 4 of 10
(7,201 Views)

what about this? (I just cheated, and checked the solution of the CLD7 challange exercise 🙂 )

 

date_snippet2.png

 

Day of week runs from 1 to 7. Today is Friday, and it gave me number 6!!! I said c'mon, it is NOT Saturday today!

Aha, but in the "western" the first day of the week is Sunday (1)... I will never get used to this strange fact that there are countries where the first day of the week is Sunday...since EVERYONE knows that, the first day is Monday...when you go to work in the morning 😄 😄

0 Kudos
Message 5 of 10
(7,199 Views)

Apparently, not "EVERYONE" would agree.  Regardless, it's a programming language.  It's not about your work week.  You could just as easily ask why the first option is 1 instead of 0.  Don't overthink things

Message 6 of 10
(7,178 Views)
Sorry, i just tried to joke, i guess it did not go through.
0 Kudos
Message 7 of 10
(7,172 Views)

Checking the solution is not cheating. 🙂

 

There is a note in the updated specification:   "For solutions using non-US time stamps the parsing will be slightly different. The provided solution is made for a US time stamp, and contains a switch that provides the two strings that would be produced by a US time stamp."

As I remember, this note was missing from the very first version and quite a few people living outside the US noticed the problem.

I agree, using Sunday as the first day of a week might be confusing for many people, especially if Monday means "beginning of the week" on your native language. 🙂

 

NI´s success package was very helpful when I prepared for my CLD, but this example was not my favourite. I have seen a much better solution somewhere, which was more compacy and elegant than the one provided by NI. I will try to find it, hopefully I saved it for future reference. 

 

Best regards,

CsabaF
0 Kudos
Message 8 of 10
(7,156 Views)

thanks all for the info!

 

And natasftw actually pointed out to a more interesting question: everything (as much as i know) is zero-based indexed in LV, but the week-days are not, starting with 1 (Sunday) not zero. It would be interesting to know the reasoning behind this decision in LV.

 

Regards!

0 Kudos
Message 9 of 10
(7,147 Views)

@Blokk wrote:

thanks all for the info!

 

And natasftw actually pointed out to a more interesting question: everything (as much as i know) is zero-based indexed in LV, but the week-days are not, starting with 1 (Sunday) not zero. It would be interesting to know the reasoning behind this decision in LV.

 

Regards!


Its a system thing

 

LabVIEW Started on the MAC and implemented the cluster in a MAC'y way


"Should be" isn't "Is" -Jay
Message 10 of 10
(7,133 Views)