[pbs-devel] [PATCH proxmox-backup 5/6] BackupDir: make constructor fallible

Dietmar Maurer dietmar at proxmox.com
Fri Sep 11 16:28:17 CEST 2020


> On 09/11/2020 4:12 PM Dietmar Maurer <dietmar at proxmox.com> wrote:
> 
>  
> > since converting from i64 epoch timestamp to DateTime is not always
> > possible. 
> 
> In our case we use UTC, and nanosecs is 0. So when will that fail?

The chrono source code contains the following comment:

  /// Converts the UTC `NaiveDateTime` to the local time.
  /// The UTC is continuous and thus this cannot fail (but can give the duplicate local time).
  fn from_utc_datetime(&self, utc: &NaiveDateTime) -> DateTime<Self> {


So what does that mean?





More information about the pbs-devel mailing list