1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use ;
use Tz;
/// Get the current local datetime as a formatted string.
/// The format of the string is "%Y-%m-%d %H:%M:%S.%3f".
///
/// # Examples
///
/// ```
/// let datetime = get_local_datetime();
/// println!("Current datetime: {}", datetime);
/// ```
/// Get the current local datetime in the specified timezone as a formatted string.
///
/// # Arguments
///
/// * `timezone` - The timezone to convert the datetime to.
///
/// # Example
///
/// ```
/// use chrono_tz::Tz;
/// use crate::get_local_datetime_in_timezone;
///
/// let timezone = Tz::UTC;
/// let datetime = get_local_datetime_in_timezone(timezone);
/// println!("Current datetime in UTC: {}", datetime);
/// ```