aboutsummaryrefslogtreecommitdiff
path: root/lib/time/time.tm
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-08-17 20:35:09 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-08-17 20:35:09 -0400
commitf4e38fd061a158ecb94881273c6db6e6a332f61d (patch)
tree9179cb312dcc1b24d806dfb65694c25580d1ed8b /lib/time/time.tm
parent602cedd03b0c3d6ef176efafb08f51bde9bfe543 (diff)
Switch from using dollar signs as namespace delimiters to using 々, ヽ, andunicode-identifiers
〇.
Diffstat (limited to 'lib/time/time.tm')
-rw-r--r--lib/time/time.tm24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/time/time.tm b/lib/time/time.tm
index 456b5f08..82d7d9eb 100644
--- a/lib/time/time.tm
+++ b/lib/time/time.tm
@@ -24,7 +24,7 @@ struct Time(tv_sec:Int64, tv_usec:Int64; extern)
char *zoneinfo = strstr(buf, "/zoneinfo/");
if (zoneinfo)
- _local_timezone = Text$from_str(zoneinfo + strlen("/zoneinfo/"));
+ _local_timezone = Textヽfrom_str(zoneinfo + strlen("/zoneinfo/"));
else
fail("Could not resolve local tz!");
}
@@ -46,17 +46,17 @@ struct Time(tv_sec:Int64, tv_usec:Int64; extern)
WITH_TIMEZONE(@timezone, final_info = localtime_r(&time, &result));
static char buf[256];
size_t len = strftime(buf, sizeof(buf), String(@format), final_info);
- Text$from_strn(buf, len)
+ Textヽfrom_strn(buf, len)
)
func new(year,month,day:Int, hour=0, minute=0, second=0.0, timezone=Time.local_timezone() -> Time)
return C_code : Time(
struct tm info = {
- .tm_min=Int32$from_int(@minute, false),
- .tm_hour=Int32$from_int(@hour, false),
- .tm_mday=Int32$from_int(@day, false),
- .tm_mon=Int32$from_int(@month, false) - 1,
- .tm_year=Int32$from_int(@year, false) - 1900,
+ .tm_min=Int32ヽfrom_int(@minute, false),
+ .tm_hour=Int32ヽfrom_int(@hour, false),
+ .tm_mday=Int32ヽfrom_int(@day, false),
+ .tm_mon=Int32ヽfrom_int(@month, false) - 1,
+ .tm_year=Int32ヽfrom_int(@year, false) - 1900,
.tm_isdst=-1,
};
@@ -154,9 +154,9 @@ struct Time(tv_sec:Int64, tv_usec:Int64; extern)
struct tm info = {};
WITH_TIMEZONE(@timezone, localtime_r(&@t.tv_sec, &info));
- info.tm_mday += Int32$from_int(@days, false) + 7*Int32$from_int(@weeks, false);
- info.tm_mon += Int32$from_int(@months, false);
- info.tm_year += Int32$from_int(@years, false);
+ info.tm_mday += Int32ヽfrom_int(@days, false) + 7*Int32ヽfrom_int(@weeks, false);
+ info.tm_mon += Int32ヽfrom_int(@months, false);
+ info.tm_year += Int32ヽfrom_int(@years, false);
time_t t = mktime(&info);
(Time){
@@ -169,8 +169,8 @@ struct Time(tv_sec:Int64, tv_usec:Int64; extern)
ret : Time?
C_code {
struct tm info = {.tm_isdst=-1};
- const char *str = Text$as_c_string(@text);
- const char *fmt = Text$as_c_string(@format);
+ const char *str = Textヽas_c_string(@text);
+ const char *fmt = Textヽas_c_string(@format);
if (strstr(fmt, "%Z"))
fail("The %Z specifier is not supported for time parsing!");