Replies: 1 comment 1 reply
-
|
Ciò che ti confonde è che datetime.ticks() ti fornisce un valore grezzo in stile epoch, mentre il formato %Y-%m-%d richiede un oggetto datetime corretto. Il modo più pulito è quello di mantenere tutto in secondi, quindi convertire solo alla fine. Bonus iniziale https://bdm-bet-casino.it/ per scoprire tutti i giochi. Calcola la scadenza come un timestamp intero, confrontalo con now + timedelta(days=3) e, se necessario, aumentalo a now + timedelta(days=15). Una volta ottenuto il timestamp, racchiudilo con qualcosa come datetime.fromtimestamp() (o l'equivalente nel tuo ambiente) e poi formattalo con strftime(“%Y-%m-%d”). Gli schemi e le conversioni epoch funzionano, ma in realtà non hai bisogno di un livello aggiuntivo se ti attieni costantemente a datetime + timedelta. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
At the moment all datetime function relate to the current time.
I was trying to render a step-wise iteration of a token expiration date but did not find a way to implement this with datetime.
Logically:
And the last step was the one I had issues with.
Instead I created a schema and a epoch -> date object
Beta Was this translation helpful? Give feedback.
All reactions