Skip to content
Snippets Groups Projects
Commit cd336e84 authored by Bruce Cowan's avatar Bruce Cowan
Browse files

Set locale

parent ce8470ce
No related branches found
No related tags found
No related merge requests found
# Copyright © 2016 Bruce Cowan <bruce@bcowan.eu> # Copyright © 2016-2018 Bruce Cowan <bruce@bcowan.eu>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from datetime import datetime from datetime import datetime
import locale
from errbot import BotPlugin, botcmd from errbot import BotPlugin, botcmd
...@@ -21,6 +22,11 @@ from errbot import BotPlugin, botcmd ...@@ -21,6 +22,11 @@ from errbot import BotPlugin, botcmd
class Datetime(BotPlugin): class Datetime(BotPlugin):
"""Functions to do with dates and times""" """Functions to do with dates and times"""
def activate(self):
super().activate()
locale.setlocale(locale.LC_TIME, '')
@staticmethod @staticmethod
def _get_date_time(fmt): def _get_date_time(fmt):
dt = datetime.now() dt = datetime.now()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment