-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visit the Time.local in the macro. #14741
Comments
This issue has been mentioned on Crystal Forum. There might be relevant details there: https://forum.crystal-lang.org/t/print-compile-time-when-app-starts/6278/16 |
I don't see a reasonable use case for embedding the build time. |
Users have their own purposes for use |
The C language offer predefined macro #include <stdio.h>
int main(void) { printf("Compiled on: %s %s\n", __DATE__, __TIME__); } $: gcc 1.c -o 1 && ./1
Compiled on: Jul 16 2024 14:43:23
@straight-shoota , can you explain why C needs to provide them? |
Most C compilers actually observe $: SOURCE_DATE_EPOCH=1711095856 gcc 1.c -o 1 && ./1
Compiled on: Mar 22 2024 08:24:16 That's great for reproducible builds. But it's different from what you would expect from We could perhaps consider introducing some utilities for working with time (especially formatting) in macros, in order to make |
Feature Request
Check discuss on this
Following is a example code
The output like this:
Above time serve as a
build time
,deploy time
, orrelease date
for CLI app, is used for confirm we are packaged the binary or deployed the website which built on specified time.I consider we should get the
Time.local
use a better way than awfulcrystal eval ...
workaround.The text was updated successfully, but these errors were encountered: