[ Home ]

file_time.c File Reference

Portable file time conversion. More...

#include <time.h>
#include "../common/common_utils.h"
#include "../common/platform.h"

Include dependency graph for file_time.c:


Defines

#define DOSTIME_STARTDATE   0x00210000L
#define DOSTIME(y, c, d, h, m, s)   ( ((y) < 1980) ? DOSTIME_STARTDATE : (((W32)(y) - 1980) << 25) | ((W32)(c) << 21) | ((W32)(d) << 16) | ((W32)(h) << 11) | ((W32)(m) << 5) | ((W32)(s) >> 1) )
 Convert the date y/n/d and time h:m:s to a four byte DOS date and time (date in high two bytes, time in low two bytes).

Functions

PUBLIC W32 UnixTimeToDosTime (time_t *t)
 Converts Unix time_t into DOS format.

Detailed Description

Portable file time conversion.

Author:
Michael Liebscher
Date:
2006

Define Documentation

#define DOSTIME ( y,
c,
d,
h,
m,
 )     ( ((y) < 1980) ? DOSTIME_STARTDATE : (((W32)(y) - 1980) << 25) | ((W32)(c) << 21) | ((W32)(d) << 16) | ((W32)(h) << 11) | ((W32)(m) << 5) | ((W32)(s) >> 1) )

Convert the date y/n/d and time h:m:s to a four byte DOS date and time (date in high two bytes, time in low two bytes).

Parameters:
[in] y year.
[in] c month.
[in] d day.
[in] h hour.
[in] m minute.
[in] s second.
Returns:
DOS time.


Function Documentation

PUBLIC W32 UnixTimeToDosTime ( time_t *  t  ) 

Converts Unix time_t into DOS format.

Parameters:
[in] t unix time to convert.
Returns:
Unix time_t in DOS format, rounded up to the next two second boundary.

Here is the caller graph for this function: