-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎨 from/to base64 simplified and handles urlsafe natively 🚧 swap_endianness 🔍 user supplied format string for from_unix_ts 🔥 unix_ts renamed to unix_timestamp 🧪 tests added/updated
- Loading branch information
Showing
12 changed files
with
64 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
from ..core import ChepyCore | ||
from typing import Any, TypeVar | ||
|
||
DateTimeT = TypeVar('DateTimeT', bound='DateTime') | ||
DateTimeT = TypeVar("DateTimeT", bound="DateTime") | ||
|
||
class DateTime(ChepyCore): | ||
def __init__(self, *data: Any) -> None: ... | ||
state: Any = ... | ||
def from_unix_ts(self: DateTimeT) -> DateTimeT: ... | ||
def to_unix_ts(self: DateTimeT) -> DateTimeT: ... | ||
def from_unix_timestamp(self: DateTimeT, format: str = ...) -> DateTimeT: ... | ||
def to_unix_timestamp(self: DateTimeT) -> DateTimeT: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
from chepy import Chepy | ||
|
||
|
||
def test_from_unix_ts(): | ||
assert Chepy("1573426649").from_unix_ts().o[-4:] == "2019" | ||
def test_from_unix_timestamp(): | ||
assert Chepy("1573426649").from_unix_timestamp().o[-4:] == "2019" | ||
|
||
|
||
# def test_to_unix_ts(): | ||
# assert Chepy("Sun Nov 10 17:57:29 2019").to_unix_ts().o == 1573426649 | ||
# def test_to_unix_timestamp(): | ||
# assert Chepy("Sun Nov 10 17:57:29 2019").to_unix_timestamp().o == 1573426649 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters