Calender, Dayofweek, Get_time – Argox PA-20 Programming Guide User Manual
Page 32: Set_time
PT-20 Programming Guide
30
Purpose: Get the day of the week information.
Syntax: int DayOfWeek(void);
Example call: day=DayOfWeek( );
Includes:
#include “SDK.h ”
Description: The DayOfWeek function returns the day of week information based on
current date.
Returns: The DayOfWeek function returns an integer indicating the day of week
information. A value of 1 to 6 represents Monday to Saturday accordingly.
And a value of 7 indicates Sunday.
Purpose: Get current date and time
Syntax: int get_time(char *cur_time);
Example call: char system_time[16];
get_time(system_time);
Includes:
#include “SDK.h ”
Description:
The get_time function reads current date and time from the calendar
chip and copies them to a character array specified in the argument
cur_time. The character array cur_time allocated must have a
minimum of 15 bytes to accommodate the date, time, and the string
terminator. The format of the system date and time is listed below.
"YYYYMMDDhhmmss"
YYYY
year, 4 digits
MM
month, 2 digits
DD
day, 2 digits
hh
hour, 2 digits
mm
minute, 2 digits
ss
second, 2 digits
Returns: Normally the get_time function always returns an integer value of 0. If the
calendar chip malfunctions, the get_time function will then return 1 to
indicate error.
Purpose: Set new date and time to the calendar chip.