Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
583aed31
Commit
583aed31
authored
Jul 03, 2012
by
Leigh B Stoller
Browse files
Fix up date parsing and insertion in PostHistoryRecord().
parent
e65166fa
Changes
1
Show whitespace changes
Inline
Side-by-side
protogeni/lib/GeniCH.pm.in
View file @
583aed31
...
...
@@ -1049,12 +1049,13 @@ sub PostHistoryRecord($)
$
record
->{$
slot
}
=
$
date
;
}
#
Leave
dates
as
GMT
if
(
! ($date =~ /^[-\w:.\/]+/)) {
#
Leave
dates
as
GMT
but
confirm
it
is
parsable
as
a
date
.
my
$
parsed_date
=
str2time
($
date
);
if
(
!defined($parsed_date)) {
return
GeniResponse
->
Create
(
GENIRESPONSE_BADARGS
,
undef
,
"
Improper date format: $slot
"
);
"
Could not parse $slot: $date
"
);
}
push
(@
insert_data
,
"$slot=
"
.
DBQuoteSpecial
($
date
));
push
(@
insert_data
,
"$slot=
FROM_UNIXTIME($parsed_
date)
"
);
}
#
Only
toplevel
aggregates
if
(
! (defined($record->{'type'}) && $record->{'type'} eq "Aggregate")) {
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment