()
| 99 | } |
| 100 | |
| 101 | fn get_git_timestamp_datetime() -> DateTime<Local> { |
| 102 | let timestamp = option_env!("RUSTPYTHON_GIT_TIMESTAMP") |
| 103 | .unwrap_or("") |
| 104 | .to_owned(); |
| 105 | let timestamp = timestamp.parse::<u64>().unwrap_or(0); |
| 106 | |
| 107 | let datetime = UNIX_EPOCH + Duration::from_secs(timestamp); |
| 108 | |
| 109 | datetime.into() |
| 110 | } |
| 111 | |
| 112 | pub fn get_git_date() -> String { |
| 113 | let datetime = get_git_timestamp_datetime(); |
no test coverage detected