请问为什么时间显示不正确,已按文档正确设置时区-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1870|回复: 7

[已解答] 请问为什么时间显示不正确,已按文档正确设置时区

[复制链接]
发表于 2020-6-7 23:02 | 显示全部楼层 |阅读模式
已在void setup()中加入Blinker.setTimezone(8.0);设置时区为什么我的串口监视器和oled显示的时间都比正确时间晚8个小时

曾尝试把时区函数改成8以外的数据,不起作用
设备是ESP8266 nodemcu温湿度传感器 dht11 屏幕0.96OLED,目前程序能运行,屏幕显示预定的开机画面,进入后显示温湿度和时间日期界面,图像部分也能正常
[mw_shl_code=arduino,true]#define BLINKER_WIFI
#define BLINKER_MIOT_SENSOR
#include <Blinker.h>
#include <DHT.h>
#include <U8g2lib.h>


char auth[] = "*";
char ssid[] = "*";
char pswd[] = "*";

BlinkerNumber HUMI("humi");
BlinkerNumber TEMP("temp");

#define DHTPIN 2
#define DHTTYPE DHT11   // DHT 11
//#define DHTTYPE DHT22   // DHT 22  (AM2302), AM2321
//#define DHTTYPE DHT21   // DHT 21 (AM2301)

#define SCL  4                   //GPIO14  D2
#define SDA  5                   //GPIO12  D1
U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, SCL, SDA, U8X8_PIN_NONE);   //scl,sda,rst



DHT dht(DHTPIN, DHTTYPE);

float humi_read = 0, temp_read = 0;


/*图像(一般以pb开头)、文字(一般以lb开头)数组*/

//开机时的图像: 88X50px length:550  sizeof:550B
const unsigned char pb_start[] U8X8_PROGMEM= {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,
0x00,0x00,0x00,0x00,0x80,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x01,0x00,0x00,
0x00,0x80,0x03,0x00,0xe0,0x00,0x00,0x00,0x00,0x80,0x0f,0x00,0xe0,0x00,0x00,0x00,
0x00,0x00,0x3e,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x30,0x00,0x00,0x00,
0x00,0x00,0xf0,0x01,0x38,0x00,0x00,0x00,0x00,0x00,0xc0,0x07,0x1c,0x00,0x00,0x00,
0x00,0x00,0x00,0x1f,0x0e,0x00,0x00,0x00,0x80,0xff,0x7f,0xff,0xff,0xff,0x1f,0x00,
0x80,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x80,0x01,0x00,0x00,0x00,0x00,0x18,0x00,
0x80,0x01,0x00,0x00,0x00,0x00,0x18,0x00,0x80,0x01,0x00,0x00,0x00,0x00,0x18,0x00,
0x80,0xf9,0xff,0xff,0xff,0xff,0x19,0x00,0x80,0xf9,0xff,0xff,0xff,0xff,0x19,0x00,
0x80,0x19,0x00,0x00,0x00,0x80,0x19,0x00,0x80,0x19,0x00,0x00,0x00,0x80,0x19,0x00,
0x80,0x19,0x00,0x00,0x00,0x80,0x19,0x00,0x80,0x19,0x00,0x00,0x00,0x80,0x19,0x00,
0x80,0x19,0x80,0x00,0x18,0x80,0x19,0x00,0x80,0x19,0xe0,0x01,0x78,0x80,0x19,0x00,
0x80,0x19,0xf8,0x00,0xf0,0x81,0x19,0x00,0x80,0x19,0x3e,0x00,0xc0,0x83,0x19,0x00,
0x80,0x19,0x0f,0x00,0x80,0x8f,0x19,0x00,0x80,0x19,0x02,0x00,0x00,0x8e,0x19,0x00,
0x80,0x19,0x00,0x00,0x00,0x80,0x19,0x00,0x80,0x19,0x80,0x40,0x10,0x80,0x19,0x00,
0x80,0x19,0x80,0x61,0x38,0x80,0x19,0x00,0x80,0x19,0x80,0xe1,0x38,0x80,0x19,0x00,
0x80,0x19,0x80,0xf3,0x38,0x80,0x19,0x00,0x80,0x19,0x80,0xff,0x1f,0x80,0x19,0x00,
0x80,0x19,0x00,0xbf,0x0f,0x80,0x19,0x00,0x80,0x19,0x00,0x0c,0x03,0x80,0x19,0x00,
0x80,0x19,0x00,0x00,0x00,0x80,0x19,0x00,0x80,0x19,0x00,0x00,0x00,0x80,0x19,0x00,
0x80,0x19,0x00,0x00,0x00,0xc0,0x19,0x00,0x80,0xf9,0xff,0xff,0xff,0xff,0x19,0x00,
0x80,0xf9,0xff,0xff,0xff,0xff,0x19,0x00,0x80,0x01,0x00,0x00,0x00,0x00,0x18,0x00,
0x80,0x01,0x00,0x00,0x00,0x00,0x18,0x00,0x80,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,
0x80,0xff,0xff,0xff,0xff,0xff,0x1f,0x00,0x00,0x7f,0x5f,0xff,0xff,0xe7,0x0f,0x00,
0x00,0x60,0x0c,0x00,0x00,0xc6,0x00,0x00,0x00,0xe0,0x0f,0x00,0x00,0x7e,0x00,0x00,
0x00,0xc0,0x07,0x00,0x00,0x7c,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};

// width: 107, height: 55
const unsigned char col2[] U8X8_PROGMEM = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0xc0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x80,0x07,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0x07,0x00,0x70,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x00,0xc0,0xff,0xff,0x07,0x00,0x30,0x00,0xc0,0xff,0xff,0x1f,0x00,0x00,0x00,0x40,0x80,0x03,0x04,0x00,0x30,0x00,0xc0,0xff,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x30,0x00,0xc0,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x30,0x00,0xc0,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x60,0x30,0x18,0xc0,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0xe0,0x30,0x1c,0xc0,0xfe,0xff,0x1f,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x60,0x30,0x38,0x00,0xfe,0xff,0x03,0x00,0x00,0x00,0x00,0x80,0x03,0x00,0x70,0x30,0x38,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0x03,0x70,0x30,0x70,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x80,0xff,0xff,0x03,0x70,0x30,0x70,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x38,0x30,0xe0,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x38,0x30,0xe0,0x00,0xfc,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x18,0x30,0xc0,0x01,0xfc,0xff,0x01,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x1c,0x30,0xc0,0x01,0x00,0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x0c,0x30,0x80,0x01,0x00,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x0e,0x30,0x80,0x01,0x00,0xe7,0x01,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x06,0x30,0x00,0x00,0x00,0xc7,0x03,0x00,0x00,0x00,0x60,0x80,0x03,0x18,0x00,0x30,0x00,0x00,0x00,0x87,0x01,0x00,0x00,0x00,0xe0,0xff,0xff,0x1f,0x00,0x30,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0xe0,0xff,0xff,0x1f,0x00,0x3f,0x00,0xe0,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0xe0,0xff,0xff,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };
// width: 48, height: 56
const unsigned char col[] U8X8_PROGMEM = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x04,0x00,
0x00,0x38,0x00,0x00,0x9c,0x7f,0xe0,0xff,0x07,0x00,0xb8,0x60,0x20,0x00,0x00,0x00,
0x80,0x60,0x20,0xcc,0x00,0x00,0x82,0x7f,0x20,0xc4,0x00,0x00,0x8e,0x60,0xa0,0xff,
0x07,0x03,0x98,0x7f,0x20,0xc4,0x00,0x03,0x00,0x00,0x20,0xfc,0x00,0x03,0x00,0x00,
0x20,0x00,0x00,0x00,0xd8,0xff,0x20,0xff,0x01,0x00,0x58,0xda,0x20,0xcc,0x00,0x03,
0x4c,0xda,0x30,0x7c,0x00,0x03,0x4c,0xda,0x30,0x78,0x00,0x03,0xe6,0xdf,0x18,0xfc,
0x00,0x00,0xf6,0xff,0xc1,0x87,0x07,0x00,0x02,0x00,0x80,0x01,0x04,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x08,0x00,0x00,0xcc,0xff,
0x00,0x38,0x00,0x00,0xd8,0x40,0xe0,0xff,0x07,0x00,0xd0,0x40,0x20,0x00,0x00,0x00,
0xc2,0x7f,0x20,0xcc,0x00,0x00,0xce,0x40,0x20,0xc4,0x00,0x00,0xdc,0x40,0xa0,0xff,
0x07,0x03,0xc8,0xff,0x20,0xc4,0x00,0x03,0x00,0x1a,0x20,0xfc,0x00,0x03,0x48,0xd2,
0x20,0x00,0x00,0x00,0x48,0xd2,0x20,0xff,0x01,0x00,0xc8,0x53,0x20,0xcc,0x00,0x03,
0x8c,0x73,0x30,0x7c,0x00,0x03,0x8c,0x33,0x30,0x78,0x00,0x03,0x04,0x1f,0x18,0xfc,
0x00,0x00,0xe6,0xff,0xc1,0x87,0x07,0x00,0x04,0x00,0x80,0x01,0x04,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};





// width: 28, height: 27
const unsigned char col3[] U8X8_PROGMEM = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x3c,0x00,0x00,0x32,0xff,0x00,0x00,
0x22,0xc3,0x00,0x00,0xb2,0xc1,0x00,0x00,0x9c,0x01,0x00,0x00,0x80,0x01,0x00,0x00,
0x80,0x01,0x00,0x00,0x80,0x01,0x00,0x00,0x80,0x01,0x00,0x00,0x80,0x81,0x00,0x00,
0x00,0xc3,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };


void dis_Time(){
  //Blinker.setTimezone(8.0);

  char str_week[]="";
  char str_date[]="";
  char str_big_Time[]="";
  char str_small_second[]="";
  int num_temp=0;
  char str_temp[6];
  
  if(Blinker.second()>=0){
    do {
      u8g2.clearBuffer();
      num_temp=Blinker.year()%100;
      if(num_temp<10){
        strcat(str_date,"0");
      }
      itoa(num_temp,str_temp,10);   //日期
      strcat(str_date,str_temp);
      num_temp=Blinker.month();               
      itoa(num_temp,str_temp,10);
      strcat(str_date,"-");
      if(Blinker.month()<10){
        strcat(str_date,"0");
      }
      strcat(str_date,str_temp);
      num_temp=Blinker.mday();
      itoa(num_temp,str_temp,10);
      strcat(str_date,"-");
      strcat(str_date,str_temp);
      num_temp=Blinker.wday();
      char* week_str[8]={"日","一","二","三","四","五","六","日"};
      strcat(str_date,"星期");
      strcat(str_date,week_str[Blinker.wday()]);
      Serial.print("日期:");
      Serial.print(str_date);
      u8g2.setFont(u8g2_font_wqy12_t_gb2312a); // 汉字 14*26
      u8g2.setCursor(25, 54);
      u8g2.print(str_date);
      num_temp=Blinker.wday();   
      itoa(num_temp,str_temp,10);   //星期
      strcat(str_week,str_temp);
      num_temp=Blinker.hour();
      itoa(num_temp,str_temp,10);   //时分
      if(Blinker.hour()<10){
        strcat(str_big_Time,"0");
      }
      strcat(str_big_Time,str_temp);      
      num_temp=Blinker.minute();
      itoa(num_temp,str_temp,10);
      strcat(str_big_Time,":");
      if(Blinker.minute()<10){
        strcat(str_big_Time,"0");
      }
      strcat(str_big_Time,str_temp);
      Serial.print("时分:");
      Serial.print(str_big_Time);
      u8g2.setFont(u8g2_font_logisoso28_tf ); // 大字 14*26
      u8g2.setCursor(20, 34);
      u8g2.print(str_big_Time);
      num_temp=Blinker.second();
      itoa(num_temp,str_temp,10); //秒
      if(Blinker.second()<10){
        strcat(str_small_second,"0");
      }
      strcat(str_small_second,str_temp);
      Serial.print("秒:");
      Serial.println(str_small_second);

     } while ( u8g2.nextPage() );
  }
}


void heartbeat()
{
    HUMI.print(humi_read);
    TEMP.print(temp_read);
}

void dataStorage()
{
    Blinker.dataStorage("temp", temp_read);
    Blinker.dataStorage("humi", humi_read);
   
}



void miotQuery(int32_t queryCode)      //小爱同学控制
{
    BLINKER_LOG("MIOT Query codes: ", queryCode);
   
            int humi_read_int=humi_read;     //去掉湿度浮点
            BlinkerMIOT.temp(temp_read);
            BlinkerMIOT.humi(humi_read_int);
            BlinkerMIOT.print();     
  
}

void dataRead(const String & data)
{
    BLINKER_LOG("Blinker readString: ", data);

    Blinker.vibrate();
   
    uint32_t BlinkerTime = millis();
   
    Blinker.print("millis", BlinkerTime);
}
void setup()
{
    Serial.begin(115200);
    BLINKER_DEBUG.stream(Serial);
    BLINKER_DEBUG.debugAll();
    pinMode(LED_BUILTIN, OUTPUT);
    digitalWrite(LED_BUILTIN, LOW);

    Blinker.begin(auth, ssid, pswd);
    Blinker.attachHeartbeat(heartbeat);
    BlinkerMIOT.attachQuery(miotQuery);
    Blinker.attachDataStorage(dataStorage);
    dht.begin();
   
    int humi_read_int=humi_read;
    int temp_read_int=temp_read;
    u8g2.begin();
    u8g2.enableUTF8Print();
    u8g2.clearBuffer();
    u8g2.drawXBMP(34,5,60,54,pb_start);
    u8g2.sendBuffer();
    Blinker.delay(2000);

    u8g2.clearBuffer();
    u8g2.drawXBMP(10,5,107,55,col2);
    u8g2.sendBuffer();
    Blinker.delay(2000);

    Blinker.setTimezone(8.0);

   
}

void loop()
{
    Blinker.run();

    float h = dht.readHumidity();
    float t = dht.readTemperature();

    if (isnan(h) || isnan(t))
    {
        BLINKER_LOG("Failed to read from DHT sensor!");
    }
    else
    {
        BLINKER_LOG("Humidity: ", h, " %");
        BLINKER_LOG("Temperature: ", t, " *C");
        humi_read = h;
        temp_read = t;
    }

   

   
   
    u8g2.clearBuffer();
    //u8g2.setFont(u8g2_font_unifont_t_chinese2);
    u8g2.setFont(u8g2_font_ncenB14_tr);
    u8g2.drawXBM(1, 5, 45, 54, col);
    //u8g2.drawXBM(80, 16,16, 24, bitmap3);
    u8g2.setCursor(46, 25);
    u8g2.print(temp_read);
    u8g2.setCursor(46, 57);
    u8g2.print(humi_read);
    //u8g2.setCursor(103, 23);
    u8g2.drawXBM(100, 5, 28, 27, col3);
    u8g2.setCursor(103, 55);
    u8g2.print("%");
    u8g2.sendBuffer();  
    Blinker.delay(4000);

    dis_Time();
    Blinker.delay(4000);
   
   
    //u8g2.setCursor(5, 15);
   // u8g2.print("温度:");
   //u8g2.setCursor(70, 14);
    //u8g2.print(temp_read);  
   // u8g2.setCursor(5, 47);
    //u8g2.print("湿度:");
   // u8g2.setCursor(70, 47);
   // u8g2.print(humi_read);
    //u8g2.sendBuffer();
   
   
   
}[/mw_shl_code]
发表于 2020-6-8 00:26 | 显示全部楼层
8266 package 2.7.1修改了时区
请更新blinker lib dev3.0分支
 楼主| 发表于 2020-6-8 09:08 | 显示全部楼层
奈何col 发表于 2020-6-8 00:26
8266 package 2.7.1修改了时区
请更新blinker lib dev3.0分支

感谢解答!已更新blinker lib dev 3.0,现在时间正常了,调整时区参数,时间会跟着变化,但不知什么原因日期有问题,比如现在是北京时间8日早上8点,我调整Blinker.setTimezone(-8.0);,程序输出的时间是6月8日16点对比网上查询的时区时间UTC-8:2020-6-7 16:58:15,日期不会跟随时区变化,是什么原因?再次感谢
发表于 2020-6-8 11:52 | 显示全部楼层
caufrankie 发表于 2020-6-8 09:08
感谢解答!已更新blinker lib dev 3.0,现在时间正常了,调整时区参数,时间会跟着变化,但不知什么原因日 ...

已更新库时间相关函数 更新dev3.0库测试
 楼主| 发表于 2020-6-8 19:54 | 显示全部楼层
三水 发表于 2020-6-8 11:52
已更新库时间相关函数 更新dev3.0库测试

就是已经更新了,时区函数已经生效了
发表于 2020-6-9 20:02 | 显示全部楼层
caufrankie 发表于 2020-6-8 19:54
就是已经更新了,时区函数已经生效了

我的意思是叫你再更新一遍
 楼主| 发表于 2020-6-10 08:23 | 显示全部楼层
三水 发表于 2020-6-9 20:02
我的意思是叫你再更新一遍

谢谢回复,是要重新下载dev3.0放到库文件夹么,原来的点灯master那个是删除还是保留?经过两天观察hour和分钟是正常了日期是咱们正常时间的早上8点才跳转的新的正确日期,比北京标准时间晚了8小时
 楼主| 发表于 2020-6-11 09:35 | 显示全部楼层
基本正常了,分享下处理过程。主要原因是BLINKER更新了8266新版2.71库,blinker更新了dev3.0,Arduino IDE 在更新中出现问题,最终删除这些文件,重新下载安装,时区函数生效,日期问题正常。旧的8266的package找到Arduino15目录删除即可,具体办法奈何大佬的帖子里有讲,论坛搜索吧,结贴!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-11-28 09:45 , Processed in 0.087174 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表