L idZddlZddlZddlmZmZddlZej dZgdZgdZ d dZ dZ d Z d Z d Zed k(r4ddlZddlZej$ej&j(yy)zKfontTools.misc.timeTools.py -- tools for working with OpenType timestamps. N)datetimetimezone) iprrrrrrr)MonTueWedThuFriSatSun) NJanFebMarAprMayJunJulAugSepOctNovDecc |tj}t|jdt|j d|j ddtjd|}|S)a Convert a tuple or struct_time representing a time as returned by gmtime() or localtime() to a 24-character string of the following form: >>> asctime(time.gmtime(0)) 'Thu Jan 1 00:00:00 1970' If t is not provided, the current time as returned by localtime() is used. Locale information is not used by asctime(). This is meant to normalise the output of the built-in time.asctime() across different platforms and Python versions. In Python 3.x, the day of the month is right-justified, whereas on Windows Python 2.7 it is padded with zeros. See https://github.com/fonttools/fonttools/issues/455  z>2z %H:%M:%S %Y)time localtimeDAYNAMEStm_wday MONTHNAMEStm_montm_mdaystrftime)tss ^/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/fontTools/misc/timeTools.pyasctimer&sP$ y NN 188  mQ'  A Hc `ttjtd|tzS)Nr)r&rgmtimemax epoch_diffvalues r%timestampToStringr.;s" 4;;s1ej&89: ;;r'cr|ddj\}}tj|ddd}|jtj |t j}tj |}|j|k(s Jd|zdzt|jtz S)Nz %d %H:%M:%S %Y)monthtzinfo"z" has inconsistent weekday) splitrstrptimereplacerindexrutcrweekdayint timestampr+)r-wkdaymnthr# wkday_idxs r%timestampFromStringr??s)//#KE4%)%67A ((.x|| DAu%I 99;) #OS5[3O%OO # q{{}  **r'ctjjd}|t|tz Stt j tz S)NSOURCE_DATE_EPOCH)osenvirongetr:r+r)source_date_epochs r% timestampNowrFHsC ':;$$% 22 tyy{Z' ((r'c&t|tz SN)r:r+r,s r%timestampSinceEpochrIPs uz! ""r'__main__rH)__doc__rBrrrcalendartimegmr+rrr&r.r?rFrI__name__sysdoctestexittestmodfailedr'r%rUs 'X__; < < " :<+)# z CHH_W__  % %& r'