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

gen: auto_str_methods.v

This commit is contained in:
Alexander Medvednikov
2020-08-01 16:36:09 +02:00
parent 2c6286b381
commit adafd24819
4 changed files with 404 additions and 370 deletions

View File

@@ -35,6 +35,7 @@ const (
31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30,
31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31,
]
long_days= ['Monday', 'Tuesday', 'Wednesday', 'Thusday', 'Friday', 'Saturday', 'Sunday']
)
pub struct Time {
@@ -272,6 +273,12 @@ pub fn (t Time) weekday_str() string {
return days_string[i * 3..(i + 1) * 3]
}
// weekday_str returns the current day as a string.
pub fn (t Time) long_weekday_str() string {
i := t.day_of_week() - 1
return long_days[i]
}
// ticks returns a number of milliseconds elapsed since system start.
pub fn ticks() i64 {
$if windows {