gmt

HTTP消息头详解

混江龙づ霸主 提交于 2019-12-02 11:11:33
但凡搞WEB开发的人都离不开HTTP(超文本传输协议),而要了解HTTP,除了HTML本身以外,还有一部分不可忽视的就是HTTP消息头。做过Socket编程的人都知道,当我们设计一个通信协议时,“消息头/消息体”的分割方式是很常用的,消息头告诉对方这个消息是干什么的,消息体告诉对方怎么干。HTTP传输的消息也是这样规定的,每一个HTTP包都分为HTTP头和HTTP体两部分,后者是可选的,而前者是必须的。每当我们打开一个网页,在上面点击右键,选择“查看源文件”,这时看到的HTML代码就是HTTP的消息体,那么消息头又在哪呢?IE浏览器不让我们看到这部分,但我们可以通过截取数据包等方法看到它。下面就来看一个简单的例子: 首先制作一个非常简单的网页,它的内容只有一行: <html><body>hello world</body></html> 把它放到WEB服务器上,比如IIS,然后用IE浏览器请求这个页面( http://localhost:8080/simple.htm ),当我们请求这个页面时,浏览器实际做了以下四项工作: 1、解析我们输入的地址,从中分解出协议名、主机名、端口、对象路径等部分,对于我们的这个地址,解析得到的结果如下:   协议名:http   主机名:localhost   端口:8080   对象路径:/simple.htm 2、把以上部分结合本机自己的信息

Get GMT String from current Date

你离开我真会死。 提交于 2019-12-02 01:58:28
I am able to get the output format that I need, but not the correct time. I need it in GMT (which is +4 hours) var dt = new Date(); var dt2 = dt.toString('yyyyMMddhhmmss'); Any ideas? The output looks like: 20120403031408 I am able to get the GMT in standard string format by doing: dt.toUTCString(); but im unable to convert it back to the yyyyMMddhhmmss string EDIT: I am using the date.js library Jonathan Lonowski date.js 's toString(format) doesn't have an option to specify "UTC" when formatting dates. The method itself (at the bottom of the file) never references any of Date 's getUTC...

How to Convert to UTC

流过昼夜 提交于 2019-12-01 20:36:20
问题 I'm getting dates & times from various sources (e.g. file's date/time from FTP server, email's date/tiem received, etc.) and need to store them all as UTC (so they all have a common reference). How do I do this? What pieces of information do I need in order to properly do the conversion. This is for a PHP web application. So, I can get my server's time zone. I'm not sure what to do next. Here are some sample inputs: Mon, 28 Jun 2010 12:39:52 +1200 2010-06-25 15:33:00 回答1: For the first case

How to Convert to UTC

我是研究僧i 提交于 2019-12-01 19:01:01
I'm getting dates & times from various sources (e.g. file's date/time from FTP server, email's date/tiem received, etc.) and need to store them all as UTC (so they all have a common reference). How do I do this? What pieces of information do I need in order to properly do the conversion. This is for a PHP web application. So, I can get my server's time zone. I'm not sure what to do next. Here are some sample inputs: Mon, 28 Jun 2010 12:39:52 +1200 2010-06-25 15:33:00 For the first case the offset is there so it should be trivial, the second example however will be considered as UTC (or any

Emacs and Git show wrong time on Windows

最后都变了- 提交于 2019-12-01 18:04:40
Emacs is two hours off from the system time. I tried to google for the problem, but no luck. What do I need to configure to correct this? I suspect this to be the difference from GMT to where I live (I'm in GMT+2 zone, that is, if I subtract from system time 2, I'll get the time in Emacs). So... maybe it's some locale settings? I just messed up a git repository because of that: commits made through magit used Emacs time, and placed them before the commits made by someone else :( Here, I've added a screenshot showing the difference. The output from the date is the correct time, but the time on

Emacs and Git show wrong time on Windows

淺唱寂寞╮ 提交于 2019-12-01 17:16:40
问题 Emacs is two hours off from the system time. I tried to google for the problem, but no luck. What do I need to configure to correct this? I suspect this to be the difference from GMT to where I live (I'm in GMT+2 zone, that is, if I subtract from system time 2, I'll get the time in Emacs). So... maybe it's some locale settings? I just messed up a git repository because of that: commits made through magit used Emacs time, and placed them before the commits made by someone else :( Here, I've

电商商品表设计

谁说胖子不能爱 提交于 2019-12-01 08:00:02
一、了解下商品中的两个概念:SPU和SKU SPU(Standard Product Unit):标准化产品单元。是商品信息聚合的最小单位,是一组可复用、易检索的标准化信息的集合,该集合描述了一个产品的特性。通俗点讲,属性值、特性相同的商品就可以称为一个SPU。 SKU=Stock Keeping Unit(库存量单位)。即库存进出计量的基本单元,可以是以件,盒,托盘等为单位。 举个例子:iPhone6是一个SPU,iPhone6 32G 白色是一个SKU,iPhone6 128G 白色是另一个SKU。 我们刚才说的 iphone6,书面称谓叫“SPU” Standard Product Unit (标准化产品单元),它是最接近用户认知的产品单元,比如用户说,我想买个 iphone4、iphone6、小米 4,这些都是 SPU,也就是用户普遍认知范围内的一种产品。然而在电商系统中只有 SPU 并没有什么卵用,用户购买时肯定要确定,需要什么颜色、多少 G 的,支持什么网络。所以,例如金色 -16G- 移动版 iphone6,就需要一个名称去规范它,这个名称叫“SKU” Stock Keeping Unit(库存单元),换句话理解就是库存里面存的东西,库存里存在东西肯定是具体的某种规格的 iphone6。基于这个理解,我们先画下图: SPU表有了,这里还是以iPhone6为例

GMT UTC 时区等概念

核能气质少年 提交于 2019-12-01 07:31:13
时间戳 定义:格林威治时间1970年01月01日00时00分00秒( 北京时间1970年01月01日08时00分00秒 )起至现在的总秒数,表示为:1970-01-01 00:00:00 UTC。 它称为Unix时间(Unix time)、POSIX时间(POSIX time)。 从定义可以看到, 全球相同时刻,不管你是什么时区, 时间戳是一致的 , 时间戳是不会跟着时区的改变而改变。用时间戳来表示时间全球都是一致的 相同时间戳,在不同时区,时间是不同的:如 1520411719 时间戳,对应北京时间是:2018-03-07 16:35:19 GMT+8,对应此时的美国华盛顿时间是:2018-03-07 03:35:19 GMT-5,这也是我们常说的时间。 格林威治时间(GMT) 是指位于英国伦敦郊区的皇家格林尼治天文台当地的平太阳时,因为本初子午线被定义为通过那里的经线。 协调世界时(UTC) 协调世界时(英语:Coordinated Universal Time简称UTC)是最主要的世界时间标准,其以原子时秒长为基础, 在时刻上尽量接近于格林尼治标准时间 。 协调世界时是世界上调节 时钟 和 时间 的主要时间标准,它与0度经线的平太阳时相差不超过1秒[4],并不遵守夏令时。 协调世界时是最接近格林威治标准时间(GMT)的几个替代时间系统之一。 对于大多数用途来说

nginx访问控制

安稳与你 提交于 2019-12-01 07:06:12
1.限制ip访问: 白名单 allow 127.0.0.1;##允许127.0.0.1访问 deny all;##其他ip全部拒绝 黑名单 deny 127.0.0.1;##拒绝这个ip访问 deny 1.1.1.1;##拒绝访问 配置 allow 127.0.0.1; ##允许这个ip访问 allow 192.168.222.0/24; ##允许这个网段访问 deny all; ##剩下全部拒绝 测试 # curl -x127.0.0.1:80 bbs.centos.com -I ##127.0.0.1可以访问 HTTP/1.1 200 OK Server: nginx/1.17.0 Date: Sun, 13 Oct 2019 05:03:38 GMT Content-Type: text/html; charset=utf-8 Connection: keep-alive X-Powered-By: PHP/7.3.0 Set-Cookie: d0iK_2132_saltkey=h6XT6j4q; expires=Tue, 12-Nov-2019 05:03:38 GMT; Max-Age=2592000; path=/; HttpOnly Set-Cookie: d0iK_2132_lastvisit=1570939418; expires=Tue, 12-Nov-2019

Date对象

萝らか妹 提交于 2019-12-01 06:57:02
Date对象是JS原生对象,既可以作为构造函数,也可以作为工具函数; 日期的零点是(0时区): 1970年1月1日 00:00:00 1. 基础知识 如果作为构造函数, 如果不传参数,返回当前时间的对象,是一个对象。 如果传参,返回指定时间(当前时区的时间)的对象。 var date = new Date();//Sat Oct 12 2019 23:51:42 GMT+0800 (中国标准时间) var date = new Date(2000,10,20); //Mon Nov 20 2000 00:00:00 GMT+0800 (中国标准时间) 如果作为工具函数,返回当前时间的字符串。不论有没有参数都是返回当前时间。 Date() === new Date().toString(); //true Date(2000,20,11) === new Date().toString() // true 2. 构造函数 1. 实例对象 通过构造函数生成的日期实例,使用时会自动调用toString()方法 2. 传参格式 1) 一个整数(正数/负数都可以),表示当前时区的时间距离1970.1.1的毫秒数 new Date(0); //Thu Jan 01 1970 08:00:00 GMT+0800 (中国标准时间) // 返回的是距离当前时区的零点时间的毫秒数,即1970-1-1