Merge pull request #16772 from sfromis/Epoch-in-Berry-time-map

Epoch in Berry time map
This commit is contained in:
s-hadinger 2022-10-09 18:21:43 +02:00 committed by GitHub
commit 058432c641
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -37,6 +37,7 @@ static int m_dump(bvm *vm)
time_insert(vm, "min", t->tm_min);
time_insert(vm, "sec", t->tm_sec);
time_insert(vm, "weekday", t->tm_wday);
time_insert(vm, "epoch", ts);
be_pop(vm, 1);
be_return(vm);
}

View File

@ -265,6 +265,7 @@ extern "C" {
be_map_insert_int(vm, "min", t->tm_min);
be_map_insert_int(vm, "sec", t->tm_sec);
be_map_insert_int(vm, "weekday", t->tm_wday);
be_map_insert_int(vm, "epoch", mktime(t));
if (unparsed) be_map_insert_str(vm, "unparsed", unparsed);
be_pop(vm, 1);
}