首页 > 其他分享 >时间转换(tm,mktime,localtime)

时间转换(tm,mktime,localtime)

时间:2023-06-15 18:13:15浏览次数:36  
标签:__ start time32 mktime schd tm today localtime

int year = 0;

    int month = 0;

    int day = 0;

    sscanf((char*)strDateInfo,"%4d%2d%2d",&year, &month, &day);

 

    struct tm paraTime = { 0, 0, 0, day, month - 1, year - 1900};

    __time32_t curDay =  _mktime32(&paraTime);

    __time32_t today;

    _time32(&today);

    struct tm* today_ptr = _localtime32(&today);

    struct tm schd_start;

    memcpy(&schd_start, today_ptr, sizeof(tm));

    schd_start.tm_hour = 0;

    schd_start.tm_min = 0;

    schd_start.tm_sec = 0;

    __time32_t stime = _mktime32(&schd_start);

标签:__,start,time32,mktime,schd,tm,today,localtime
From: https://www.cnblogs.com/xiaoxiaoshi/p/17483692.html

相关文章

  • STM32CUBEIDE RTC
    voidsetTime(){RTC_DateTypeDefsDate;RTC_TimeTypeDefsTime;sDate.WeekDay=4;sDate.Month=6;sDate.Date=8;sDate.Year=23;HAL_RTC_SetDate(&hrtc,&sDate,RTC_FORMAT_BIN);sTime.Hours=14;sTime.Minutes......
  • url欺诈--HTML5无刷修改url
     window.history.pushState({},0,'http://'+window.location.host+'/'+url); url--要修改的网址a标签欺诈<script>window.onclick=function(){       //触发单击事件,修改链接  document.links[0].setAttribute('href','http://google.com');}&......
  • html canvas写字并右对齐
    functionPaintText(x,y,color,size,text,toLeft){if(toLeft==undefined){toLeft=true;}y+=size;ctx.font="normal"+size+"pxarial";ctx.fillStyle=color;if(toLeft){ctx.fillText(text,x,y);}......
  • 解析 Postman Newman:从入门到精通
    PostmanNewman是什么?PostmanNewman是一个CLI(命令行界面)工具,可以使用它来运行Postman中的集合(Collection)和环境(Environment)进行自动化测试。它是Postman的命令行CollectionRunner,能够直接从命令行运行Postman集合。使用Newman可以测试API的功能、性能、可靠性和安......
  • STM32嵌入式面试知识点总结
    一、STM32F1和F4的区别?解答:参看:STM32开发–STM32初识内核不同:F1是Cortex-M3内核,F4是Cortex-M4内核;主频不同:F1主频72MHz,F4主频168MHz;浮点运算:F1无浮点运算单位,F4有;功能性能:F4外设比F1丰富且功能更强大,比如GPIO翻转速率、上下拉电阻配置、ADC精度等;内存大小:F1内部SRAM最大64K,F4有1......
  • 结对编程神器:tmux
    tmux的确比Screen帅气啊!mark:https://github.com/aqua7regia/tmux-Productive-Mouse-Free-Development_zh/blob/master/book-content/Chapter5.md结对编程要求两人都能输入,如果是教学,希望client端不能写,只需要attach-session-r即可目前的疑问:tmux我设置`(反引号)为控制符,搞得我没法......
  • ubuntu开发stm32单片机-环境搭建
    1、首先安装串口助手(ch340驱动)首先查看操作系统中自带的串口驱动arvin@arvin-virtual-machine:/lib/modules/5.19.0-43-generic/kernel/drivers/usb/serial$lsaircable.kof81232.koiuu_phoenix.komxuport.koquatech2.kousbserial.koark3116.k......
  • STM32低功耗配置
    一、电源介绍1.1STM32下的电源管理电源框图电源标号说明电压调节器复位后调节器总是使能。以3种不同的模式工作。运转模式:调节器以正常功耗模式提供1.8V电源(内核,内存和外设)。停止模式:调节器以低功耗模式提供1.8V电源,以保存寄存器和SRAM的内容。待机模式:调节器停止供......
  • Wtm layui add form pop out and dispaly in tables
    #regionAddChargeItem[AllRights]//useineditpagepublicIActionResultAddChargeJob(stringid){varvm=Wtm.CreateVM<tbl_ma_dbn_jobListVM>();vm.SearcherMode=ListVMSearchModeEnum......
  • HTML5 WebUploader 分片上传
    ​ 一、基本介绍 1,什么是WebUploader?WebUploader是由百度公司团队开发的一个以HTML5为主,FLASH为辅的现代文件上传组件。官网地址:http://fex.baidu.com/webuploader/JS-文件上传组件WebUploader使用详解2(MD5秒传、判断是否已经上传过)2,功能特点分片、并发:WebUplo......