请教一个以前有人问过的问题:如何从CLIENT端获取SERVER端的系统时间?

Judas 2000-04-25 11:29:00
程序需要加入一个日志记录,需要记录每项操作的时间和内容,为保证时间的统一,欲取SERVER端的系统时间,如何在程序中做到这一点?
...全文
184 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Judas 2000-04-25
  • 打赏
  • 举报
回复
补充:SERVER端数据库为SYBASE。
请教huitor:SYBASE 中的读取服务器系统时间的方法是什么?
huitor 2000-04-25
  • 打赏
  • 举报
回复
1、假设利用数据库,很容易实现。多数数据库提供了读取服务器系统时间的方法。如MS SQL SERVER,可以通过getdate()来实现。
2、自己编写一个Socket程序,提供时间服务。客户端发出请求读取服务器时间。
3、好象有Time Server,只要安装之后,工作站和服务器时间能够同步。此时只需读客户机时间即可。
光明山人 2000-04-25
  • 打赏
  • 举报
回复
Sybase也是: select GetDate();

用API取:
The NetRemoteTOD function returns the time of day information from a specified server.

Security Requirements

No special group membership is required to successfully execute NetRemoteTOD.

NET_API_STATUS NetRemoteTOD(

LPTSTR UncServerName,
LPBYTE *BufferPtr
);


Parameters

UncServerName

Pointer to a Unicode string containing the name of the remote server on which the function is to execute. A NULL pointer or string specifies the local computer.

BufferPtr

On return a pointer to the return information structure TIME_OF_DAY_INFO is returned in the address pointed to by BufferPtr.

一、prometheus简介 Prometheus是一个开源的系统监控和告警系统,现在已经加入到CNCF基金会,成为继k8s之后第二个在CNCF维护管理的项目,在kubernetes容器管理系统中,通常会搭配prometheus进行监控,prometheus支持多种exporter采集数据,还支持通过pushgateway进行数据上报,Prometheus再性能上可支撑上万台规模的集群。 二、prometheus架构图 三、prometheus组件介绍 1.Prometheus Server: 用于收集和存储时间序列数据。 2.Client Library: 客户库,检测应用程序代码,当Prometheus抓取实例的HTTP点时,客户库会将所有跟踪的metrics指标的当前状态发送到prometheus server。 3.Exporters: prometheus支持多种exporter,通过exporter可以采集metrics数据,然后发送到prometheus server 4.Alertmanager: 从 Prometheus server 接收到 alerts 后,会进行去重,分组,并路由到相应的接收方,发出报警,常见的接收方式有:电子邮件,微信,钉钉, slack等。 5.Grafana:监控仪表盘 6.pushgateway: 各个目标主机可上报数据到pushgatewy,然后prometheus server统一从pushgateway拉取数据。 四、课程亮点 五、效果图展示 六、讲师简介 先超(lucky):高级运维工程师、资深DevOps工程师,在互联网上市公司拥有多年一线运维经验,主导过亿级pv项目的架构设计和运维工作 主要研究方向: 1.云计算方向:容器 (kubernetes、docker),虚拟化(kvm、Vmware vSphere),微服务(istio),PaaS(openshift),IaaS(openstack)等2.系统/运维方向:linux系统下的常用组件(nginx,tomcat,elasticsearch,zookeeper,kafka等),DevOps(Jenkins+gitlab+sonarqube+nexus+k8s),CI/CD,监控(zabbix、prometheus、falcon)等 七、课程大纲

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧