LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

get day of week from system clock

Is there a CVI function that returns the system day of week from the PC clock?
I am using GetSystemDate and GetSystemTime but also want to know the day of week ie. Mon, Tue, Wed ,...
Alternatively does anyone have code for calculating this from the system date?

I notice in toolbox there is a function to get international date and time as strings but that doesn't seem to include week-day either
0 Kudos
Message 1 of 5
(4,185 Views)
Hi,

Please refer to a previous post at http://forums.ni.com/ni/board/message?board.id=180&message.id=13304
Hope that solves your problem.

Regards,
Siddu
Message 2 of 5
(4,182 Views)
Hello,

I didn't test it.

But the idea it's the following:

1 - the files saved are in this format "weeknumber".txt
2 - they are saved on the same folder

Everytime it executes, adds the current week with .txt extension. then compares all the files in the folder with current week number. If the search result it's "-1", it doesn't exists. So you should save.

Tell me if this enough
Software developer
www.mcm-electronics.com





PORTUGAL
0 Kudos
Message 3 of 5
(3,988 Views)

Thanks, but I realised that standard C function "localtime" generetaes a structure with day of week

 time(&long_time);          // Get time as long integer.
 newtime = localtime(&long_time);     // Convert to local time structure.
 wkday = newtime->tm_wday;       // Day Of Week = Days since Sunday 0-6

0 Kudos
Message 4 of 5
(3,981 Views)

You must post your query in the LabWindows/CVI forums, NOT here anymore... Smiley Mad

You ve been advised already first.

Please dont repest your blunders.

- Partha ( CLD until Oct 2027 🙂 )
Message 5 of 5
(3,963 Views)