mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 07:11:41 +00:00
correct the date format to match the new format used by the new CVS. the
offset from GMT is also parsed out, but is not currently used. Also, there is no need to subtract 1900 from the year when passing to timegm(), as it assumes values over 999 are the actual year.
This commit is contained in:
parent
6d329e0118
commit
0d6af140b8
2 changed files with 7 additions and 3 deletions
1
TODO
1
TODO
|
@ -6,6 +6,7 @@ I = in progress
|
|||
W = waiting on other work
|
||||
|
||||
|
||||
|
||||
X fix skybox/dome vis problems (workable solution found, needs new renderer)
|
||||
X It's possible to stick on some obtuse-angled corners qwsv 2.3x didn't
|
||||
X ~/.quakeforgerc should support all commands, not just set and setrom
|
||||
|
|
|
@ -891,15 +891,18 @@ sub parse_date_and_author ()
|
|||
# Parses the date/time and author out of a line like:
|
||||
#
|
||||
# date: 1999/02/19 23:29:05; author: apharris; state: Exp;
|
||||
#
|
||||
# new line format:
|
||||
# date: 2001-01-09 05:58:40 +0000; author: taniwha; state: Exp;
|
||||
|
||||
my $line = shift;
|
||||
|
||||
my ($year, $mon, $mday, $hours, $min, $secs, $author) = $line =~
|
||||
m#(\d+)/(\d+)/(\d+)\s+(\d+):(\d+):(\d+);\s+author:\s+([^;]+);#
|
||||
my ($year, $mon, $mday, $hours, $min, $secs, $offset, $author) = $line =~
|
||||
m#(\d+)-(\d+)-(\d+)\s+(\d+):(\d+):(\d+)\s+([+-]\d+);\s+author:\s+([^;]+);#
|
||||
or die "Couldn't parse date ``$line''";
|
||||
die "Bad date or Y2K issues" unless ($year > 1969 and $year < 2258);
|
||||
# Kinda arbitrary, but useful as a sanity check
|
||||
my $time = timegm($secs,$min,$hours,$mday,$mon-1,$year-1900);
|
||||
my $time = timegm($secs,$min,$hours,$mday,$mon-1,$year);
|
||||
|
||||
return ($time, $author);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue