Embedded Xinu Operating System
An ongoing research project and educational operating system.
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
Functions | Variables
date.c File Reference
#include <clock.h>
#include <date.h>

Functions

uint get_datetime (void)
 
uint set_datetime (uint dt)
 
void printDate (uint dt)
 
void printDateTZ (uint dt, char timezone)
 
void convertDate (struct time *t, uint seconds)
 

Variables

char days_in_month [] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
 
char * month_names []
 
char * weekday_names []
 
char * tz_names []
 

Function Documentation

void convertDate ( struct time *  t,
uint  seconds 
)

Convert seconds (since 1900) to a more clear time structure.

Parameters
timetime structure
secondsseconds since 1900
uint get_datetime ( void  )

Get the system date time.

Returns
current system date time
void printDate ( uint  dt)

Print the current date and time based on the system timezone.

Parameters
dtdate time (seconds since Jan. 1, 1900)
void printDateTZ ( uint  dt,
char  timezone 
)

Print the current date and time based on passed timezone.

Parameters
dtdate time (seconds since Jan. 1, 1900)
timezonetimezone offset in hours
uint set_datetime ( uint  dt)

Set the system date time.

Parameters
dtcurrent date time (in seconds since Jan. 1, 1900)
Returns
current system date time

Variable Documentation

char* month_names[]
Initial value:
= { "January", "February", "March", "April",
"May", "June", "July", "August",
"September", "October", "November", "December"
}
char* tz_names[]
Initial value:
= {
"", "", "", "", "", "",
"", "", "", "", "", "",
"", "", "H", "AK", "P", "M",
"C", "E", "A", "", "", ""
}
char* weekday_names[]
Initial value:
= { "Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday"
}