Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Florestan Biaux
Messenger Statistics
Commits
4a185c3e
Commit
4a185c3e
authored
Jul 21, 2021
by
Adrien Simon
Browse files
ajout de decode pour les timestamp
parent
b130a933
Changes
3
Hide whitespace changes
Inline
Side-by-side
decode.py
View file @
4a185c3e
from
datetime
import
datetime
def
string_decode
(
chaine
):
return
chaine
.
encode
(
'latin1'
).
decode
(
'utf8'
)
\ No newline at end of file
return
chaine
.
encode
(
'latin1'
).
decode
(
'utf8'
)
def
timestamp_decode
(
date_ts
):
date_ts
=
int
(
str
(
date_ts
)[:
-
3
])
# on enleve les millisecondes
date_dt
=
datetime
.
fromtimestamp
(
date_ts
)
# conversion en date yyyy-mm-dd
time_dt
=
str
(
date_dt
)[
-
8
:]
# on prend les 8 derniers caracteres pour recup l'heure
date_dt
=
date_dt
.
strftime
(
'%d-%m-%Y'
)
+
" "
+
time_dt
# on concatene la date en dd-mm-yyyy et l'heure
return
date_dt
get.py
View file @
4a185c3e
...
...
@@ -15,7 +15,6 @@ def getname(name):
def
getfile
(
name
):
originpath
=
os
.
getcwd
()
path
=
os
.
getcwd
()
+
"/messages/inbox/"
os
.
chdir
(
path
)
...
...
main.py
View file @
4a185c3e
...
...
@@ -13,7 +13,7 @@ if __name__ == "__main__":
# choose action to do
choice
=
0
while
choice
!=
3
:
choice
=
int
(
input
(
"
\n
1 - Afficher les messages
\n
2 - Afficher les participants
\n
3- Quitter l
\'
application
\n
"
))
choice
=
int
(
input
(
"
\n
1 - Afficher les messages
\n
2 - Afficher les participants
\n
3
- Quitter l
\'
application
\n
"
))
if
choice
==
1
:
print
(
data
)
if
choice
==
2
:
...
...
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