github.com/easysoft/zendata@v0.0.0-20240513203326-705bd5a7fd67/demo/22_datetime.yaml (about)

     1  fields:
     2    - field: date
     3      from: time.date.v1.yaml
     4      use: date
     5      postfix: " "
     6  
     7    - field: cn_date
     8      from: time.date.v1.yaml
     9      use: chinese
    10      postfix: " "
    11  
    12    - field: time
    13      from: time.time.v1.yaml
    14      use: time
    15      postfix: " "
    16  
    17    - field: time1                                  # 生成时间数据,以当前时间为准,从一月前到一周后。
    18      range: "(-10Y)-(+1w):10"                       # 支持当前时间的运算,Y、M、D、W、h、m、s分别对应年、月、日、周、时、分、秒。
    19      type: timestamp
    20      format: "YYYY/MM/DD hh:mm:ss"
    21      postfix: "\t"
    22  
    23    - field: time2                                  # 生成时间数据,指定起止时间的方式,从早上9点到今天结束,间隔1分钟(60秒)。
    24      range: "20210101 000000-20210101 230000:60"   # 起始、结束时间用-分隔,默认为当天的开始和结束时间。
    25      type: timestamp
    26      format: "YY/MM/DD hh:mm:ss"
    27      postfix: "\t"
    28  
    29    - field: time3                                  # 只设置一个时间时,默认当作起始时间,结束时间为当前日期的23时59分59秒
    30      range: "20210821 000000:60"                   # 和20210821 000000-:60效果是一样的
    31      type: timestamp
    32      format: "YY/MM/DD hh:mm:ss"
    33      postfix: "\t"
    34  
    35    - field: time4
    36      range: "-20210830 235959:60"                  # 省略起始时间的用法
    37      type: timestamp
    38      format: "YY/MM/DD hh:mm:ss"
    39      postfix: "\t"
    40  
    41    - field: time5                                  # 生成时间数据,以当前时间为准,从一月前到一周后。
    42      range: "(-1M)-(+1w):60m"                      # 步长支持Y、M、D、W、h、m、s分别对应年、月、日、周、时、分、秒
    43      type: timestamp
    44      format: "YY/MM/DD hh:mm:ss"
    45      postfix: "\t"
    46  
    47    - field: time6                                  # 生成时间数据,以当前时间为准,从一月前到一周后。
    48      range: "(-1M)-(+1w):1D"                       # 步长支持Y、M、D、W、h、m、s分别对应年、月、日、周、时、分、秒
    49      type: timestamp
    50      format: "YY/MM/DD hh:mm:ss"
    51      postfix: "\t"
    52  
    53    - field: time7                                  # 生成时间数据,以当前时间为准,从一月前到一周后。
    54      range: "(+1w)-(-1M):-1D"                      # 步长为-1天
    55      type: timestamp
    56      format: "YY/MM/DD hh:mm:ss"
    57      postfix: "\t"
    58  
    59    - field: time8                                  # 生成时间数据,以当前时间为准,从一月前到一周后。
    60      range: "(+1w)-(-1M):1D"                       # 设置步长为1天,但是会自动的根据起止时间调整正负,实际为-1天
    61      type: timestamp
    62      format: "YY/MM/DD hh:mm:ss"