Format Day And Time


nguyenbaotrung555

Recommended Posts

Posted

Where does it show mm/dd/yy?  The channel table shows YMD,  and graphs show D DoW Month YYYY.  If you use formatDate() it should use your system locale, or use formatdatetime("%c",systime()).  You can always format the way you want using formatdatetime().

Posted

I show it at "Alarms" . When i create one alarm set. I want to show time and day error. 

FormatDateTime("%c",Alarm.GreaterThen.TimeFired)

My computer was format dd/mm/yyyy. but Alarm of DAQ is mm/dd/yyyy ? I can't fix it ! 

Posted

%c uses the system locale settings.  So, go to Windows Control Panel and change the Region and Language settings to display it properly.

 

Alternatively, use the other specifiers, for example:

 

formatDateTime("%d/%m/%Y", Alarm.GreaterThen.TimeFired)

 

BTW: I think you want "GreaterThan".  "Then" is used after "if", such as "if x then y" and is followed by an action.  "Than" refers to something, x is greater than y, and is followed by an object (or number).

  • 4 months later...
Posted

FormatDateTime() function is crashing DAQFactory. At the command prompt if I type: ? FormatDateTime("%Y-%m-%d %H:%M:%S", SysTime()) is crashing DAQFactory. Is this a bug or is my syntax wrong?

Posted

Ok, strange. Restarted my PC and DAQFactory. Opened new document and works ok. Opened my old document and it is working there as well now. Yesterday I had restarted DAQFactory several times and each time this command crashed DAQFactory.

Archived

This topic is now archived and is closed to further replies.