mirror of
https://github.com/silverstripe/silverstripe-mssql
synced 2024-10-22 08:05:53 +02:00
BUGFIX MSSQLDatabase::formattedDatetimeClause() should account for the timezone when returning a UNIX timestamp
This commit is contained in:
parent
083517d02b
commit
ba4f843819
@ -1474,7 +1474,9 @@ class MSSQLDatabase extends SS_Database {
|
||||
$date = "'$date.000'";
|
||||
}
|
||||
|
||||
if($format == '%U') return "DATEDIFF(s, '19700101 12:00:00:000', $date)";
|
||||
if($format == '%U') {
|
||||
return "DATEDIFF(s, '1970-01-01 00:00:00', DATEADD(hour, DATEDIFF(hour, GETDATE(), GETUTCDATE()), $date))";
|
||||
}
|
||||
|
||||
$trans = array(
|
||||
'Y' => 'yy',
|
||||
|
Loading…
Reference in New Issue
Block a user