R语言的时间格式

作者: Datacruiser | 来源:发表于2017-02-15 23:16 被阅读158次

格式 說明

%a Abbreviated weekday name

%A Full weekday name

%b Abbreviated month name

%B Full month name

%c Date and time, locale-specific.

%d Day of the month as decimal number (01-31).

%H Hours as decimal number (00-23).

%I Hours as decimal number (01-12).

%j Day of year as decimal number (001-366).

%m Month as decimal number (01-12).

%M Minute as decimal number (00-59).

%p AM/PM indicator in the locale.

Used in conjuction with ’%I’ and *not* with ’%H’.

%S Second as decimal number (00-61), allowing for up to two leap-seconds

%U Week of the year as decimal number (00-53)

using the first Sunday as day 1 of week 1.

%w Weekday as decimal number (0-6, Sunday is 0).

%W Week of the year as decimal number (00-53)

using the first Monday as day 1 of week 1.

%x Date, locale-specific.

%X Time, locale-specific.

%y Year without century (00-99).

If you use this on input, which century you get is system-specific. So don’t!

Often values up to 69 (or 68) are prefixed by 20 and 70-99 by 19.

%Y Year with century.

%z (output only.) Offset from Greenwich, so ’-0800’ is 8 hours west of Greenwich.

%Z (output only.) Time zone as a character string (empty if not available).

%F Equivalent to %Y-%m-%d (the ISO 8601 date format).

%g The last two digits of the week-based year (see ’%V’).

%G The week-based year (see ’%V’) as a decimal number.

%u Weekday as a decimal number (1-7, Monday is 1).

%V Week of the year as decimal number (00-53).

If the week (starting on Monday) containing 1 January

has four or more days in the new year, then it is considered week 1.

Otherwise, it is the last week of the previous year,

and the next week is week 1.

%D Locale-specific date format such as ’%m/%d/%y’.

%k The 24-hour clock time with single digits preceded by a blank.

%l The 12-hour clock time with single digits preceded by a blank.

%n Newline on output, arbitrary whitespace on input.

%r The 12-hour clock time (using the locale’s AM or PM).

%R Equivalent to ’%H:%M’.

%t Newline on output, arbitrary whitespace on input.

%T Equivalent to ’%H:%M:%S’.

相关文章

  • R语言的时间格式

    格式 說明 %a Abbreviated weekday name %A Full weekday name %b...

  • 常用的跨语言通信方案

    常用的跨语言通信方案 传统的跨语言通信方案: 基于SOAP消息格式的WebService 基于JSON消息格式的R...

  • UltraEdit 高亮显示R代码

    UltraEdit 默认高亮显示格式没有R,可以通过添加,实现R语法高亮显示。编码>添加其他语言 找到R,勾选即可。

  • Go语言标准库之time

    Go语言标准库之time 时间的格式化和解析 格式化 FormatGo语言和其他语言的时间格式化的方式不同,Go语...

  • Go语言标准库之time

    Go语言标准库之time 时间的格式化和解析 格式化 Format Go语言和其他语言的时间格式化的方式不同,Go...

  • 保存R中的数据

    R语言中内置了两种数据格式,除了将数据导出为我们常用的.xls、.csv外,使用R内置的数据格式可以方便以后的再次...

  • 6-R读取多个文件并合并为一个文件

    R语言可以读取的数据格式 txt格式,分隔符默认为,或空格,可省略read.table(filename,head...

  • R语言读写R格式文件2021.2.24

    1、读取R格式文件 1.1 读写RDS格式文件 1.1.1 导出RDS文件 1.1.2 读取RDS文件 直接双击已...

  • R语言_文件读取与保存

    把外部数据读入R语言里以及在R语言处理的数据导出,怎么操作以及注意哪些细节: 1.认识csv格式2.认识分隔符3....

  • R语言读取NC格式数据

    数据准备 国家地球系统科学数据中心下载的全国逐月最低气温数据集,每3年数据共36个月的最低气温数据保存在一个nc文...

网友评论

    本文标题:R语言的时间格式

    本文链接:https://www.haomeiwen.com/subject/xzrcwttx.html