Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
767f4ae9
Commit
767f4ae9
authored
Aug 26, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use strftime in plugin
parent
8780b4d6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
15 deletions
+1
-15
dream/plugins/GetCurrentTime.py
dream/plugins/GetCurrentTime.py
+1
-15
No files found.
dream/plugins/GetCurrentTime.py
View file @
767f4ae9
...
@@ -10,20 +10,6 @@ class GetCurrentTime(plugin.InputPreparationPlugin):
...
@@ -10,20 +10,6 @@ class GetCurrentTime(plugin.InputPreparationPlugin):
currentTime
=
data
[
'general'
].
get
(
'currentDate'
,
None
)
currentTime
=
data
[
'general'
].
get
(
'currentDate'
,
None
)
if
not
currentTime
:
if
not
currentTime
:
currentTime
=
datetime
.
datetime
.
now
()
currentTime
=
datetime
.
datetime
.
now
()
year
=
currentTime
.
year
month
=
currentTime
.
month
day
=
currentTime
.
day
minute
=
currentTime
.
minute
hour
=
currentTime
.
hour
minute
=
currentTime
.
minute
second
=
currentTime
.
second
dateFormat
=
data
[
'general'
].
get
(
'dateFormat'
,
'%Y/%m/%d %H:%M'
)
dateFormat
=
data
[
'general'
].
get
(
'dateFormat'
,
'%Y/%m/%d %H:%M'
)
if
dateFormat
==
'%Y/%m/%d %H:%M:%S'
:
data
[
'general'
][
'currentDate'
]
=
currentTime
.
strftime
(
dateFormat
)
currentTimeString
=
str
(
year
)
+
'/'
+
str
(
month
).
zfill
(
2
)
+
'/'
+
str
(
day
).
zfill
(
2
)
+
' '
+
str
(
hour
).
zfill
(
2
)
+
':'
+
str
(
minute
).
zfill
(
2
)
+
':'
+
str
(
second
).
zfill
(
2
)
elif
dateFormat
==
'%Y/%m/%d %H:%M'
:
currentTimeString
=
str
(
year
)
+
'/'
+
str
(
month
).
zfill
(
2
)
+
'/'
+
str
(
day
).
zfill
(
2
)
+
' '
+
str
(
hour
).
zfill
(
2
)
+
':'
+
str
(
minute
).
zfill
(
2
)
elif
dateFormat
==
'%Y/%m/%d'
:
currentTimeString
=
str
(
year
)
+
'/'
+
str
(
month
).
zfill
(
2
)
+
'/'
+
str
(
day
).
zfill
(
2
)
print
currentTimeString
data
[
'general'
][
'currentDate'
]
=
currentTimeString
return
data
return
data
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment