gettimeofday_PHP gettimeofday()函数与示例

gettimeofday

PHP gettimeofday()函数 (PHP gettimeofday() function)

gettimeofday() function is used to get the current time.

gettimeofday()函数用于获取当前时间。

Syntax:

句法:

    gettimeofday(return_float);

Parameter(s):

参数:

  • return_float – It is an optional parameter which is used to specify the return value as float instead of an associative array. To specify the float value – we set its value as "true".

    return_float –这是一个可选参数,用于将返回值指定为float而不是关联数组。 要指定浮点值–我们将其值设置为“ true”。

Return value:

返回值:

It returns an associative array with the following key values,

它返回具有以下键值的关联数组,

  • sec            - it is used to get the time in seconds since the UNIX epoch

    sec-用于获取自UNIX时代以来的时间(以秒为单位)

  • usec          - it is used to get the time in microseconds

    usec-用于获取时间(以微秒为单位)

  • minuteswest         - it is used to get the time in minutes (west of Greenwich)

    minuteswest-用于获取以分钟为单位的时间(格林威治以西)

  • dsttime     - it is used for the type of dst correction

    dsttime-用于dst校正的类型

Example: PHP code to demonstrate an example of gettimeofday() function

示例:PHP代码演示gettimeofday()函数的示例

<?php
//getting the time with all keys
$result = gettimeofday();
echo "gettimeofday()...\n";
print_r($result);
//extracting indivisual values based on the keys
echo "sec:          $result[sec]\n";
echo "usec:         $result[usec]\n";
echo "minuteswest:  $result[minuteswest]\n";
echo "dsttime:      $result[dsttime]\n";
//getting time in float
$result = gettimeofday(true);
echo "result in float: $result\n";
?>

Output

输出量

gettimeofday()...
Array
(
[sec] => 1565701750
[usec] => 950047
[minuteswest] => 0
[dsttime] => 0
)
sec:          1565701750
usec:         950047
minuteswest:  0
dsttime:      0
result in float: 1565701751.0216

Reference: PHP gettimeofday() function

参考: PHP gettimeofday()函数

翻译自: https://www.includehelp.com/php/gettimeofday-function-with-example.aspx

gettimeofday

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/541061.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Shell脚本/bin/bash^M: bad interpreter错误解决方法

2019独角兽企业重金招聘Python工程师标准>>> 在windows下保存了一个脚本文件&#xff0c;用ssh上传到centos&#xff0c;添加权限执行nginx提示没有那个文件或目录。 shell脚本放到/etc/init.d/目录下&#xff0c;再执行/etc/init.d/nginx&#xff0c;提示多了这句/…

java中map的遍历方法_Java中Map的三种遍历方式

集合中的三种遍历方式&#xff0c;如下代码&#xff1a;import java.util.Collection;import java.util.HashMap;import java.util.Iterator;import java.util.Map;import java.util.Set;import java.util.TreeMap;public class TestMap {public static void main(String[] arg…

uuid hashcode_Java UUID hashCode()方法与示例

uuid hashcodeUUID类hashCode()方法 (UUID Class hashCode() method) hashCode() method is available in java.util package. hashCode()方法在java.util包中可用。 hashCode() method is used to retrieve the hash code for this UUID. hashCode()方法用于检索此UUID的哈希码…

java如何遍历combobox_如何通过COMBOBOX设置Java中的框架标题?

我想创建类似下图的内容,当用户从组合框选项中选择年份、月份和日期时,这些操作将更改标题,并且必须根据所选数据进行更改,这很简单,我还是新手到目前为止,我已经做到了,问题是它不起作用,我怎么能做到呢?,你能帮我一下吗?import java.awt.GridLayout;import java.awt.event.…

为什么公司要努力发展数字化战略

发现自身数字化滞后的公司正在遭受因为在二十年前所做的战略决策的煎熬。这里我们将阐述如何才能迎头赶上。 发展数字化战略的公司正在努力促进转型&#xff0c;因为大多数首席信息官(CIO)还没有能力成为数字化领导者。根据Caldwell Partners公司的技术、数字和数据领导事务的管…

java scanner_Java Scanner radix()方法与示例

java scanner扫描器类radix()方法 (Scanner Class radix() method) radix() method is available in java.util package. radix()方法在java.util包中可用。 radix() method is used to return the default or implicit radix of this Scanner. radix()方法用于返回此Scanner的…

java用mysql存储图片_Java存储图片到Mysql

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼【1】视图层action"${ctx}/web/UserInforServlet?methoduserInforServlet" >更换头像立即提交重置var layer,upload,form;//1-页面数据加载$(function () {//【1】加载&初始化layui模块-弹出层与table数据表格la…

ITU衡量信息社会报告:我国ICT发展指数进入亚太前十

11月22日&#xff0c;国际电信联盟&#xff08;ITU&#xff09;发布2016版《衡量信息社会报告》&#xff0c;公布了最新国家和地区ICT发展指数&#xff08;IDI&#xff09;。《报告》显示&#xff0c;排在前十位的国家和地区均来自欧洲和亚洲&#xff0c;韩国以0.01分的优势再次…

treeset java_Java TreeSet clear()方法与示例

treeset javaTreeSet类的clear()方法 (TreeSet Class clear() method) clear() method is available in java.util package. clear()方法在java.util包中可用。 clear() method is used to clear all of the objects that exist from this TreeSet. clear()方法用于清除此TreeS…

Facebook也大干新闻聚合 “新闻快读”向所有媒体开放

去年五月&#xff0c;Facebook推出了不离开本站直接阅读新闻的聚合服务“新闻快读”&#xff08;Instant Articles&#xff09;&#xff0c;用户载入文章的速度大增&#xff0c;不过当时只面向一些特定合作的新闻机构。日前&#xff0c;这一聚合服务全面开始接纳所有的新闻媒体…

kafka偏移量保存到mysql里_【队列】调试应用时进行的kafka偏移量调整

# KAFKA操作记录##export BASE_DIR/home/dba/kafkaexport SERVERS1.1.1.1:9092cd ${BASE_DIR}/bin# 删除残留的消费者./kafka-consumer-groups.sh --bootstrap-server $SERVERS --group DBAAlertSplash --delete --command-config ${BASE_DIR}/config/client.properties# 这个在…

java scanner_Java Scanner match()方法与示例

java scanner扫描器类match()方法 (Scanner Class match() method) match() method is available in java.util package. match()方法在java.util包中可用。 match() method is used to get the MatchResult of the last scanning operation operated by this Scanner. match()…

苹果再次拒绝协助美国政府解锁纽约毒品案中的iPhone

继美国联邦调查局(FBI)成功解锁圣贝纳迪诺市恐袭案枪手 Syed Farook所使用的iPhone 5c后&#xff0c;美国司法部已撤回对苹果公司采取的法律行动。然而近日美国司法部宣布&#xff0c;将继续要求苹果公司协助解锁一部在纽约毒品调查案中查获的iPhone 5s手机。不过苹果今天向美国…

openssl java aes_请问如何使用AES对使用OpenSSL命令加密的Java文件进行解密?

以下是OpenSSLPBEInputStream和OpenSSLPBEOutputStream它可以用于以与OpenSSL兼容的方式加密/解密任意字节流。示例用法&#xff1a;// The original clear text bytesbyte[] originalBytes ...// Encrypt these byteschar[] pwd "thePassword".toCharArray();Byte…

Java ArrayList set()方法与示例

ArrayList类set()方法 (ArrayList Class set() method) set() method is available in java.util package. set()方法在java.util包中可用。 set() method is used to replace the element at the given indices with the given ele(element) in this Arraylist. set()方法用于…

《R的极客理想—工具篇》—— 第2章 时间序列基础包

本节书摘来自华章出版社《R的极客理想—工具篇》一 书中的第2章&#xff0c;作者&#xff1a;张丹&#xff0c;更多章节内容可以访问云栖社区“华章计算机”公众号查看。 第2章 时间序列基础包 本章主要介绍了时间序列数据处理的3个工具包&#xff0c;帮助读者掌握时间序列在R语…

java结构设计_Java基本的程序设计结构(一)

前言&#xff1a;虽然说学过设计模式&#xff0c;J2EE&#xff0c;这个学期才开始学Java&#xff0c;呵呵&#xff0c;有点颠倒了&#xff0c;但是还是要从基本的抓起。hoho&#xff5e;&#xff5e;(一)一个简单的java应用程序Package edu.ynu.java.lession1/*The simplest Ja…

Java ArrayList get()方法与示例

ArrayList类的get()方法 (ArrayList Class get() method) get() method is available in java.util package. get()方法在java.util包中可用。 get() method is used to retrieve the element at the given index in this Arraylist. get()方法用于检索此Arraylist中给定索引处…

第三方应用商店仍为用户获取APP主渠道 细分市场或成新增长点

近年来&#xff0c;在应用分发市场领域随着渠道多元化趋势日渐显现&#xff0c;第三方应用商店似乎已经显得乏善可陈&#xff0c;缺少亮点。事实上&#xff0c;根据比达咨询(Big Data-Research)发布的《2016年第一季度中国第三方应用商店市场研究报告》显示&#xff0c;第三方应…

java反射 动态调用_java反射拼接方法名动态执行方法

近期由于负责项目的一个模块,该模块下有很多分类,每个分类都有一个编码code,这个值是作为一个参数携带过来的.但是每个code确实对应一个方法的.code的值有很多个,自己又不想做ifelse或者switch判断于是就狂搜资料,主要让我发现利用java的反射机制可以完美的解决这个问题测试代码…