Time.second()

来自Microduino Wikipedia
跳转至: 导航搜索
time.second()

  • 作用:

提取当前秒钟

  • 参数:无
  • 例子:
#include <TimeLib.h>
Time time;

void setup(){
    Serial.begin(115200);
    time.setTime(15, 45, 00, 10, 7, 2017);//设置时间(2017年7月10日,15:45:00)
}

void loop(){
    Serial.print(time.year());
    Serial.print('/');
    Serial.print(time.month());
    Serial.print('/');
    Serial.print(time.day());
    Serial.print(' ');
    Serial.print(time.hour());
    Serial.print(':');
    Serial.print(time.minute());
    Serial.print(':');
    Serial.print(time.second());
    Serial.println();
    delay(1000);
}


[返回Data_Time语法手册]