1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

time: make Time struct public

This commit is contained in:
Mihael Dimoski 2019-10-25 21:04:25 +02:00 committed by Alexander Medvednikov
parent 8364130a1f
commit b6fa252fc9

View File

@ -44,7 +44,7 @@ const (
#include <time.h> #include <time.h>
struct Time { pub struct Time {
pub: pub:
year int year int
month int month int
@ -61,7 +61,7 @@ fn C.localtime(int) &C.tm
fn remove_me_when_c_bug_is_fixed() { // TODO fn remove_me_when_c_bug_is_fixed() { // TODO
} }
struct C.time_t {} pub struct C.time_t {}
struct C.tm { struct C.tm {
tm_year int tm_year int
@ -132,7 +132,7 @@ pub fn unix(abs int) Time {
hour := int(abs%seconds_per_day) / seconds_per_hour hour := int(abs%seconds_per_day) / seconds_per_hour
minute := int(abs % seconds_per_hour) / seconds_per_minute minute := int(abs % seconds_per_hour) / seconds_per_minute
second := int(abs % seconds_per_minute) second := int(abs % seconds_per_minute)
if is_leap_year(year) { if is_leap_year(year) {
// Leap year // Leap year
if day > 31+29-1 { if day > 31+29-1 {