mirror of
https://github.com/dschmenk/apple2pi.git
synced 2024-11-18 21:05:57 +00:00
Fix date formats
This commit is contained in:
parent
b17af70266
commit
f902991dad
BIN
src/fusea2pi
Executable file
BIN
src/fusea2pi
Executable file
Binary file not shown.
@ -173,6 +173,9 @@ static unsigned char *prodos_path(const char *uname, int *type, int *aux, unsign
|
||||
}
|
||||
static unsigned int prodos_time(int year, int month, int day, int hour, int minute)
|
||||
{
|
||||
if (year > 99)
|
||||
year -= 100;
|
||||
month += 1;
|
||||
return (day & 0x1F) | ((month & 0x0F) << 5) | ((year & 0x7F) << 9)
|
||||
| ((minute & 0x3F) << 16) | ((hour & 0x1F) << 24);
|
||||
}
|
||||
@ -182,11 +185,12 @@ static time_t unix_time(unsigned int ptime)
|
||||
memset(&tm, 0, sizeof(struct tm));
|
||||
tm.tm_mday = ptime & 0x1F;
|
||||
tm.tm_mon = (ptime >> 5) & 0x0F;
|
||||
tm.tm_year = (ptime >> 9) & 0x7F + 1900;
|
||||
tm.tm_year = (ptime >> 9) & 0x7F;
|
||||
tm.tm_min = (ptime >> 16) & 0x3F;
|
||||
tm.tm_hour = (ptime >> 24) & 0x1F;
|
||||
if (tm.tm_year < 1980)
|
||||
if (tm.tm_year < 80)
|
||||
tm.tm_year += 100;
|
||||
tm.tm_mon -= 1;
|
||||
return mktime(&tm);
|
||||
}
|
||||
struct stat *unix_stat(struct stat *stbuf, int storage, int access, int blocks, int size, int mod, int create)
|
||||
|
1110
src/fusea2pi.c~
Executable file
1110
src/fusea2pi.c~
Executable file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user