yymmdd

Function yymmdd 

Source
pub fn yymmdd(timestamp: i64, separator: Option<&str>) -> Result<String, Error>
Expand description

Formats a timestamp as “yy-MM-dd”

This function now includes validation using TimestampUtils::validate_timestamp().

§Arguments

  • timestamp - Timestamp in milliseconds since Unix epoch
  • separator - Optional separator between year, month, day (defaults to “”)

§Example

use ccxt_core::time::yymmdd;

let ts = 1704110400000;
let formatted = yymmdd(ts, None).unwrap();
assert_eq!(formatted, "240101");

let formatted_dash = yymmdd(ts, Some("-")).unwrap();
assert_eq!(formatted_dash, "24-01-01");