We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
sncb-nmbs.fetch
arrow
datetime
1 parent 29d44dd commit 2135847Copy full SHA for 2135847
.bin/sncb-nmbs.fetch
@@ -3,7 +3,8 @@
3
import os
4
import sys
5
import json
6
-import arrow
+from zoneinfo import ZoneInfo
7
+from datetime import datetime
8
import urllib.request
9
10
TZ = 'Europe/Brussels'
@@ -25,14 +26,14 @@ for connection in config['connections']:
25
26
_from = connection['from']
27
_to = connection['to']
28
- now = arrow.now(TZ)
29
+ now = datetime.now(ZoneInfo(TZ))
30
31
params = {
32
'lang' : 'en' ,
33
'format' : 'json' ,
34
'timeSel' : 'depart' ,
- 'date' : now.format('DDMMYY') ,
35
- 'time' : now.format('HHmm') ,
+ 'date' : now.strftime('%d%m%y') ,
36
+ 'time' : now.strftime('%H%M') ,
37
'from' : _from ,
38
'to' : _to
39
}
0 commit comments