首页 > 其他分享 >delphi Unix时间戳 转yyyy-mm-dd hh:mm:ss 格式字符串

delphi Unix时间戳 转yyyy-mm-dd hh:mm:ss 格式字符串

时间:2024-04-24 15:22:47浏览次数:25  
标签:mm delphi yyyy ss hh DateTimeValue dd

function UnixTimeStampToDateTimeStr(UnixTimeStamp: Int64): string;
var
  DateTimeValue: TDateTime;
begin
  //第二个参数 默认为true,设置为false,会默认以本地时区来 + 8小时,因为mysql里村的utc时间 秒数
  DateTimeValue := UnixToDateTime(UnixTimeStamp  div 1000, False);
  // 如果你需要特定的格式,比如 yyyy-mm-dd hh:mm:ss,你可以这样:
  Result := FormatDateTime('yyyy-mm-dd hh:mm:ss', DateTimeValue);
end;


procedure TForm2.Button2Click(Sender: TObject);
begin
  ShowMessage(UnixTimeStampToDateTimeStr(1713693812742));
end;

image

标签:mm,delphi,yyyy,ss,hh,DateTimeValue,dd
From: https://www.cnblogs.com/del88/p/18155534

相关文章

  • An Analysis of Sequential Recommendation Datasets
    目录概统计角度论证实验论证代码WoolridgeD.,WilnerS.andGlickM.Ananalysisofsequentialrecommendationdatasets.PERSPECTIVES,2021.概本文讨论了MovieLens系列数据集是否适用于序列推荐.统计角度论证作者为了论证MovieLens不适合作为序列推荐数据集,......
  • 2022 China Collegiate Programming Contest (CCPC) Mianyang | 2022 CCPC 绵阳(MAED
    搬运自本人知乎文章。https://zhuanlan.zhihu.com/p/588646549M.Rock-Paper-ScissorsPyramid题目链接Problem-M-Codeforces题意有一个长度为\(n\)的石头剪刀布序列,每个元素是RPS(石头、布、剪刀)中的一个,我们需要用这个序列构造一个三角,三角的底层为这个序列,第\(i(......
  • 代码层面上学习Gemma模型
    总览本文留下调试Gemma模型的记录。很乱,但我想不出更好的组织方式了。gemma-2b模型被封装在GemmaForCausalLM类中,这个类继承于GemmaPreTrainedModel。而模型的本体是GemmaModel类(这个对象实例包含在GemmaForCausalLM实例中)。也继承于GemmaPreTrainedModel。GemmaP......
  • English Grammar Analysis
    目录各种功能词的认识名词(Noun)冠词(Article)代词(Pronoun)动词(Verb)介词(Preposition)形容词(Adjective)副词(Adverb)量词(Quantifier)情态动词(ModalVerb)连词(Conjunction)感叹词(Interjection)数词(Numeral)句型动词不定式动名词分词名词性从句定语从句和关系代词定语从句和关系副词状语从句虚拟语......
  • delphi模板引擎
    开源地址:https://github.com/sempare/sempare-delphi-template-engineprogramExample;usesSempare.Template;typeTInformation=recordname:string;favourite_sport:string;count:integer;end;beginvartpl:=Template.Parse(......
  • Delphi10.3如何将ListBox1项,拖动 到 右边Memo1当前输入项
    01]ListBox1的DragMode设置为dmAutomatic02】Memo1的OnGragOver事件和OnDragDrop事件 procedureTForm8.Memo1DragOver(Sender,Source:TObject;X,Y:Integer;State:TDragState;varAccept:Boolean);beginifTListBox(Source)=ListBox1thenAccept:=true;end;......
  • The 18-th Beihang University Collegiate Programming Contest (BCPC 2023) - Final
    https://codeforces.com/gym/104883A#include<bits/stdc++.h>usingnamespacestd;usingi32=int32_t;usingi64=longlong;usingvi=vector<int>;i32main(){ios::sync_with_stdio(false),cin.tie(nullptr);i64n,sum=0;c......
  • 搭建一个简易的 PMML 模型测试环境
    PMML,全称为PredictiveModelMarkupLanguage,是一种标准化的模型描述和交换格式。它允许从不同的数据挖掘和机器学习软件中导出模型,并在其他系统中进行部署,无需重新编写代码。PMML通过定义一套统一的规则来描述模型,包括数据预处理、模型参数以及输入输出格式等。目前PMML已支持......
  • github的Contributions找不到自己:设置git commit邮箱与用户名
    最近发现公司的开源项目github都找不到我的名字公司前端库TDesign无论是vue还是react,都找不到我:https://github.com/Tencent/tdesign-vue/graphs/contributors部门的前端库vue2vue3版本照样没有自己 https://github.com/TencentBlueKing/bkui-vue3 为什么Github没有记录你......
  • VMmark 4 - 虚拟化平台基准测试
    VMmark4-虚拟化平台基准测试VMmarkisafreetoolusedtomeasuretheperformanceandscalabilityofvirtualizationplatforms.请访问原文链接:VMmark4-虚拟化平台基准测试,查看最新版。原创作品,转载请保留出处。作者主页:sysin.orgVMmark是一款免费工具,用于衡量虚......