]>
git.proxmox.com Git - rustc.git/blob - vendor/gix-date/src/time/mod.rs
612a3cdef82db527bc7fca2a23e57f0c6b0957f8
5 /// Return true if this time has been initialized to anything non-default, i.e. 0.
6 pub fn is_set(&self) -> bool
{
7 *self != Self::default()
10 /// Return the passed seconds since epoch since this signature was made.
11 pub fn seconds(&self) -> u32 {
12 self.seconds_since_unix_epoch
16 /// Indicates if a number is positive or negative for use in [`Time`].
17 #[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)]
18 #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
19 #[allow(missing_docs)]
25 /// Various ways to describe a time format.
26 #[derive(Debug, Clone, Copy)]
28 /// A custom format typically defined with the [`format_description`][time::format_description] macro.
29 Custom(&'a
[time
::format_description
::FormatItem
<'a
>]),
30 /// The seconds since 1970, also known as unix epoch, like `1660874655`.
32 /// The seconds since 1970, followed by the offset, like `1660874655 +0800`
42 use crate::time
::Sign
;
44 impl From
<i32> for Sign
{
45 fn from(v
: i32) -> Self {
56 use crate::{time::Sign, Time}
;
58 impl Default
for Time
{
59 fn default() -> Self {
61 seconds_since_unix_epoch
: 0,