```rust use cvdate::CvDate;
//let d = CvDate::new(1582939726);//if only local timezone let d = CvDate::newwithtz(1582939726, 8); asserteq!(d.getdate(), "2020-02-29"); asserteq!(d.gettime(), "09:28:46"); asserteq!(d.getdatetime(), "2020-02-29 09:28:46"); asserteq!(d.getweek(), 6); asserteq!(d.gettimezone(), 8); asserteq!(d.format("%d/%m/%Y %H:%M"), "29/02/2020 09:28"); asserteq!(CvDate::isleap(2020), true); asserteq!(CvDate::is_leap(2021), false); ```
```rust use cvdate::CvDate;
//let d = CvDate::newwithstr("%Y/%m-%d %H:%M:%S","2020-07-29 15:23:27");//if only local timezone let d = CvDate::newwithstrtz("%Y/%m-%d %H:%M:%S","2020-07-29 15:23:27", 8); asserteq!(d.gettimestamp(), 1596007407); asserteq!(d.getdate(), "2020-07-29"); asserteq!(d.gettime(), "15:23:27"); asserteq!(d.getdatetime(), "2020-07-29 15:23:27"); asserteq!(d.getweek(), 3); asserteq!(d.format("%d/%m/%Y %H:%M"), "29/07/2020 15:23"); asserteq!(CvDate::isleap(2020), true); asserteq!(CvDate::is_leap(2021), false); ```
```rust use cvdate::CvDate;
//timezone east 8 str time to other area let x = CvDate::newwithstrtz("%Y-%m-%d %H:%M:%S","2020-02-29 05:23:27", 8); //timezone east +9 asserteq!(CvDate::newwithtz(x.gettimestamp(), 9).getdatetime(), "2020-02-29 06:23:27"); //timezone west -10 asserteq!(CvDate::newwithtz(x.gettimestamp(), -10).getdate_time(), "2020-02-28 11:23:27"); ```
```rust use cvdate::CvDate;
asserteq!(CvDate::getclender(2020,2), [(1,6),(2,7),(3,1),(4,2),(5,3),(6,4),(7,5),(8,6),(9,7),(10,1),(11,2),(12,3),(13,4),(14,5),(15,6),(16,7) ,(17,1),(18,2),(19,3),(20,4),(21,5),(22,6),(23,7),(24,1),(25,2),(26,3),(27,4),(28,5),(29,6)]); ```