#conversion Clear
Tags #php #kotlin #bash #go #sql #rust #typescript #html #java #python #files #utils #strings #http #concurrency #async #json #arrays #security #types #crypto #database #dates #format
Bash Epoch ↔ Human Date Conversion
`date +%s` gives now-as-epoch; `date -d @N` converts an epoch number back to a human date. Often what API responses expect / return.
Go strconv — String ↔ Number Conversions
`strconv.Atoi` / `Itoa` for the common int<->string case; `ParseFloat`, `ParseBool`, `Quote` for everything else. Always handle the error — strings can be anything.
Rust From / Into Conversions
Implement `From` and you get `Into` for free. Then `.into()` and `T::from(x)` both work. The single most idiomatic way to express type conversions in Rust.