Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ae9d651

Browse files
committed
MNT: deprecate epoch2num/num2epoch
1 parent 99d19f7 commit ae9d651

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/dates.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1744,6 +1744,8 @@ def _get_interval(self):
17441744
return self._interval
17451745

17461746

1747+
@_api.deprecated("3.5",
1748+
alternative="mdates.date2num(datetime.utcfromtimestamp(e))")
17471749
def epoch2num(e):
17481750
"""
17491751
Convert UNIX time to days since Matplotlib epoch.
@@ -1764,7 +1766,7 @@ def epoch2num(e):
17641766

17651767
return (dt + np.asarray(e)) / SEC_PER_DAY
17661768

1767-
1769+
@_api.deprecated("3.5", alternative="mdates.num2date(e).timestamp()")
17681770
def num2epoch(d):
17691771
"""
17701772
Convert days since Matplotlib epoch to UNIX time.

0 commit comments

Comments
 (0)