Skip to content

Instantly share code, notes, and snippets.

@meme
Created January 17, 2020 02:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meme/8bb83dd617d30438e8d752bfa9e73334 to your computer and use it in GitHub Desktop.
Save meme/8bb83dd617d30438e8d752bfa9e73334 to your computer and use it in GitHub Desktop.
var buffer: [64]u8 = undefined;
const clock: c.time_t = c.time(null);
const time: ?*c.tm = c.localtime(&clock);
const size = c.strftime(@ptrCast([*]u8, &buffer), @sizeOf(@TypeOf(buffer)), "%Y-%m-%d %H:%M:%S", time);
const stdout = &std.io.getStdOut().outStream().stream;
std.debug.warn("{}", .{buffer[0..size]});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment