Enter Sublime Text ( Build 4143 )
Preferences > Browse Packages… > [ User ] folder > [ datetime.py ] file :
import sublime, sublime_plugin, time
from datetime import datetime
class InsertDatetimeCommand(sublime_plugin.TextCommand):
def run(self, edit):
sel = self.view.sel();
for s in sel:
now__________________ = datetime.now()
year_________________ = now__________________.strftime('%Y')
month___without_zeros = now__________________.strftime('%-m')
day_____without_zeros = now__________________.strftime('%-d')
hour____without_zeros = now__________________.strftime('%-I')
minutes_with____zeros = now__________________.strftime("%M")
minutes_without_zeros = minutes_with____zeros.lstrip('0')
seconds_with____zeros = now__________________.strftime('%S')
seconds_without_zeros = seconds_with____zeros.lstrip('0')
microseconds_________ = now__________________.strftime('%f')
am_pm________________ = now__________________.strftime('%p')
timezone_____________ = now__________________.strftime('%z')
internet_id_and_loc__ = 'richi' + '@' + 'com-vass-nateevo-glonass'
datetime_____________ = internet_id_and_loc__ + '-' + year_________________ + '-' + month___without_zeros + '-' + day_____without_zeros + '-' + hour____without_zeros + '-' + minutes_without_zeros + '-' + seconds_without_zeros + '-' + microseconds_________ + '-' + am_pm________________ + '-' + timezone_____________
self.view.replace(edit, s, now__________________.strftime(datetime_____________))
Preferences > Key Bindings :
[
{
"keys": ["f5"],
"command": "insert_datetime"
}
]
When I press F5 inside Sublime Text Context, Timezone does not work.
Example:
F5
richi@com-vass-nateevo-glonass-2023-6-15-6-7-17-657958-PM-??
Why?