mirror of
https://github.com/gchq/CyberChef
synced 2025-12-05 23:53:27 +00:00
'To UNIX Timestamp' operation now defaults to UTC instead of your local timezone.
This commit is contained in:
@@ -46,6 +46,12 @@ const DateTime = {
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @constant
|
||||
* @default
|
||||
*/
|
||||
TREAT_AS_UTC: true,
|
||||
|
||||
/**
|
||||
* To UNIX Timestamp operation.
|
||||
*
|
||||
@@ -55,7 +61,8 @@ const DateTime = {
|
||||
*/
|
||||
runToUnixTimestamp: function(input, args) {
|
||||
let units = args[0],
|
||||
d = moment(input);
|
||||
treatAsUTC = args[1],
|
||||
d = treatAsUTC ? moment.utc(input) : moment(input);
|
||||
|
||||
if (units === "Seconds (s)") {
|
||||
return d.unix();
|
||||
|
||||
Reference in New Issue
Block a user