ID EN
Date & Time

weekdays

R Base 3.6.2 🇮🇩 Bahasa Indonesia

Ekstrak hari kerja, bulan atau kuartal, atau waktu Julian (hari sejak asal tertentu). Ini adalah fungsi umum: metode untuk kelas tanggal-waktu internal didokumentasikan di sini.

Syntax

R
weekdays(x, abbreviate)
# S3 method for POSIXt
weekdays(x, abbreviate = FALSE)
# S3 method for Date
weekdays(x, abbreviate = FALSE)<p></p><p>months(x, abbreviate)
# S3 method for POSIXt
months(x, abbreviate = FALSE)
# S3 method for Date
months(x, abbreviate = FALSE)</p><p>quarters(x, abbreviate)
# S3 method for POSIXt
quarters(x, &#8230;)
# S3 method for Date
quarters(x, &#8230;)</p><p>julian(x, &#8230;)
# S3 method for POSIXt
julian(x, origin = as.POSIXct("1970-01-01", tz = "GMT"), &#8230;)
# S3 method for Date
julian(x, origin = as.Date("1970-01-01"), &#8230;)</p>

Arguments

Parameter Deskripsi
x an object inheriting from class "POSIXt" or "Date".
abbreviate logical vector (possibly recycled). Should the names be abbreviated?
origin an length-one object inheriting from class "POSIXt" or "Date".
&#8230; arguments for other methods.

Return Value

hari kerja dan bulan mengembalikan vektor karakter nama di lokal yang digunakan. quarters mengembalikan vektor karakter "Q1" ke "Q4". julian mengembalikan jumlah hari (mungkin pecahan) sejak asal, dengan asal sebagai atribut "asal". Semua penghitungan waktu di R dilakukan dengan mengabaikan detik kabisat.

Contoh

Example
R
# NOT RUN {
weekdays(.leap.seconds)
months(.leap.seconds)
quarters(.leap.seconds)

## Julian Day Number (JDN, https://en.wikipedia.org/wiki/Julian_day)
## is the number of days since noon UTC on the first day of 4317 BC.
## in the proleptic Julian calendar.  To more recently, in
## 'Terrestrial Time' which differs from UTC by a few seconds
## See https://en.wikipedia.org/wiki/Terrestrial_Time
julian(Sys.Date(), -2440588) # from a day
floor(as.numeric(julian(Sys.time())) + 2440587.5) # from a date-time
# }

See Also

DateTimeClasses Date