Timestamp in seconds (Epoch style)
This commit is contained in:
parent
644f647653
commit
e56a89e3ed
2 changed files with 9 additions and 5 deletions
|
|
@ -10,7 +10,7 @@ Singleton {
|
|||
property var date: new Date()
|
||||
property string time: Settings.data.location.use12HourClock ? Qt.formatDateTime(date, "h:mm AP") : Qt.formatDateTime(
|
||||
date, "HH:mm")
|
||||
property string dateString: {
|
||||
readonly property string dateString: {
|
||||
let now = date
|
||||
let dayName = now.toLocaleDateString(Qt.locale(), "ddd")
|
||||
dayName = dayName.charAt(0).toUpperCase() + dayName.slice(1)
|
||||
|
|
@ -38,6 +38,11 @@ Singleton {
|
|||
+ (Settings.data.location.reverseDayMonth ? `${month} ${day}${suffix} ${year}` : `${day}${suffix} ${month} ${year}`)
|
||||
}
|
||||
|
||||
// Returns a Unix Timestamp (in seconds)
|
||||
readonly property string timestamp: {
|
||||
return Math.floor(Date.now() / 1000);
|
||||
}
|
||||
|
||||
// Format an easy to read approximate duration ex: 4h32m
|
||||
// Used to display the time remaining on the Battery widget
|
||||
function formatVagueHumanReadableDuration(totalSeconds) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue