Come convertire i secondi in formato HH: MM: SS in SQLite?Come convertire i secondi in formato HH: MM: SS in SQLite?
risposta
Provate questo:
sqlite> SELECT time(10, 'unixepoch');
00:00:10
Bene, vorrei fare qualcosa di simile, ma io sono ore che ottengono più 12 ...
SELECT strftime('%H-%M-%S', CAST(<seconds here>/86400.0 AS DATETIME))
-- For subtracting the 12 hours difference :S
SELECT strftime('%H-%M-%S', CAST(<seconds here>/86400.0 AS DATETIME) - 0.5)
penso che sia adjustjing per l'inizio dell'epoca. So che può funzionare, lo risolverò. – vfclists
bene, grazie per il nudge !! Pensavo che nessuno avrebbe risposto, quindi l'ho lasciato fuori –
Se i secondi sono più di 24 ore , devi calcolarlo da solo. Ad esempio, con 10secondi, arrotondando per difetto al minuto:
SELECT (100123/3600) || ' hours, ' || (100123%3600/60) ||' minutes.'
27 hours, 48 minutes
I time
o strftime
funzioni saranno ovviamente convertire ogni 24 ore per un altro giorno.
SELECT time(100123, 'unixepoch')
03:48:43
Si potrebbe anche calcolare le ore, e utilizzare strftime per minuti e secondi:
SELECT (100123/3600) || ':' || strftime('%M:%S', 100123/86400.0 - 0.5);
27:48:43
- 1. Python: convertire secondi per hh: mm: ss
- 2. DATEDIFF in HH: MM: formato SS
- 3. Conversione dei secondi in giorni, hh: mm: ss C#
- 4. L'uscita è in secondi. convertire in hh: mm: formato ss in php
- 5. PostgreSQL - Come convertire i secondi in un campo numerico in HH: MM: SS
- 6. Come convertire hh: mm: ss.000 in millisecondi in Excel?
- 7. come convertire una data gg/mm/aaaa in aaaa-MM-gg HH: mm: ss Android
- 8. Convertire il periodo dal formato "hh: mm: ss" a "hh: mm"
- 9. Semplicissimo modo di convertire HH: MM: SS (ore: minuti: secondi.split secondi) in secondi
- 10. Come convertire hh: mm: ss in hh: mm in SQL Server?
- 11. Convert HH: MM: SS stringa di secondi solo in javascript
- 12. Come convertire il valore dell'ora decimale in hh: mm: ss
- 13. LibreOffice Intervallo di tempo SUM in formato HH: MM: SS
- 14. Come convertire HH: MM: SS in pochi secondi utilizzando C# .net?
- 15. Convertire HH: MM: SS.mm di secondi in bash
- 16. Conteggio secondi di visualizzazione in HH: MM: formato SS in SSRS 2008
- 17. Formato Java yyyy-MM-dd'T'HH: mm: ss.SSSz a aaaa-mm-gg HH: mm: ss
- 18. Come formattare una data in gg/mm/aaaa HH: mm: formato ss in JavaScript?
- 19. Come convertire yyyy-MM-dd hh: mm: ss a "15 aprile 2010" usando PHP
- 20. Come convertire un numero intero (orario) in HH: MM: SS :: 00 in SQL Server 2008?
- 21. Come convertire un numero decimale in tempo, ad es. HH: MM: SS
- 22. L'ora corrente in HH: MM: SS am/pm format?
- 23. formato datetime di AAAA-MM-GG HH: mm: ss in moment.js
- 24. Java String to Date oggetto del formato "aaaa-mm-gg HH: mm: ss"
- 25. Corrispondenza espressione regolare Java per hh: mm: ss in stringa
- 26. Come convertire HH: mm: ss.SSS in millisecondi?
- 27. Come ottenere la data GMT in aaaa-mm-gg hh: mm: ss in PHP
- 28. come convertire una data HH: MM: SS in secondo con bash?
- 29. Come visualizzare la data in formato HH: mm: ss in JasperReports?
- 30. WPF Datagrid tempo formato hh: mm campo
Questo è quello che pensavo inizialmente, ma ho usato strftime invece del tempo – vfclists