@@ -47,7 +47,7 @@ fn init2(gpa: std.mem.Allocator, path: ?[]const u8, level: std.log.Level) !void
47
47
var bw = std .io .bufferedWriter (logfile .writer ());
48
48
bw .writer ().print (
49
49
\\
50
- \\-----seamstress startup time: {}-----
50
+ \\-----seamstress startup time: {}-----
51
51
\\
52
52
, .{date }) catch {};
53
53
bw .flush () catch {};
@@ -73,14 +73,14 @@ const Date = struct {
73
73
.seconds = into_day .getSecondsIntoMinute (),
74
74
.minute = into_day .getMinutesIntoHour (),
75
75
.hour = into_day .getHoursIntoDay (),
76
- .day = month .day_index ,
76
+ .day = month .day_index + 1 ,
77
77
.month = month .month .numeric (),
78
78
.year = year .year ,
79
79
};
80
80
}
81
81
82
82
pub fn format (date : Date , comptime _ : []const u8 , _ : std.fmt.FormatOptions , writer : anytype ) ! void {
83
- try writer .print ("{[year]d:0>4}-{[month]d:0>2}-{[day]d:0>2} {[hour]d:0>2}:{[minute]d:0>2}:{[seconds]d:0>2}" , date );
83
+ try writer .print ("{[year]d:0>4}-{[month]d:0>2}-{[day]d:0>2} UTC {[hour]d:0>2}:{[minute]d:0>2}:{[seconds]d:0>2}" , date );
84
84
}
85
85
86
86
test format {
@@ -92,9 +92,9 @@ const Date = struct {
92
92
.minute = 27 ,
93
93
.seconds = 5 ,
94
94
};
95
- var buf : [4 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 ]u8 = undefined ;
95
+ var buf : [4 + 1 + 2 + 1 + 2 + 1 + 3 + 1 + 2 + 1 + 2 + 1 + 2 ]u8 = undefined ;
96
96
const str = try std .fmt .bufPrint (& buf , "{}" , .{date });
97
- try std .testing .expectEqualStrings ("2025-01-04 10:27:05" , str );
97
+ try std .testing .expectEqualStrings ("2025-01-04 UTC 10:27:05" , str );
98
98
}
99
99
};
100
100
@@ -130,3 +130,7 @@ pub const known_folders_config: folders.KnownFolderConfig = .{
130
130
const std = @import ("std" );
131
131
const builtin = @import ("builtin" );
132
132
const folders = @import ("known-folders" );
133
+
134
+ test "ref" {
135
+ _ = Date ;
136
+ }
0 commit comments