久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<tfoot id='flQah'></tfoot><legend id='flQah'><style id='flQah'><dir id='flQah'><q id='flQah'></q></dir></style></legend>
  • <i id='flQah'><tr id='flQah'><dt id='flQah'><q id='flQah'><span id='flQah'><b id='flQah'><form id='flQah'><ins id='flQah'></ins><ul id='flQah'></ul><sub id='flQah'></sub></form><legend id='flQah'></legend><bdo id='flQah'><pre id='flQah'><center id='flQah'></center></pre></bdo></b><th id='flQah'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='flQah'><tfoot id='flQah'></tfoot><dl id='flQah'><fieldset id='flQah'></fieldset></dl></div>
        <bdo id='flQah'></bdo><ul id='flQah'></ul>

      <small id='flQah'></small><noframes id='flQah'>

      1. 創(chuàng)建具有設(shè)定時區(qū)的日期而不使用字符串表示

        Create a Date with a set timezone without using a string representation(創(chuàng)建具有設(shè)定時區(qū)的日期而不使用字符串表示)

      2. <small id='du5ug'></small><noframes id='du5ug'>

      3. <legend id='du5ug'><style id='du5ug'><dir id='du5ug'><q id='du5ug'></q></dir></style></legend>
            <tbody id='du5ug'></tbody>
          <tfoot id='du5ug'></tfoot>
            • <bdo id='du5ug'></bdo><ul id='du5ug'></ul>

            • <i id='du5ug'><tr id='du5ug'><dt id='du5ug'><q id='du5ug'><span id='du5ug'><b id='du5ug'><form id='du5ug'><ins id='du5ug'></ins><ul id='du5ug'></ul><sub id='du5ug'></sub></form><legend id='du5ug'></legend><bdo id='du5ug'><pre id='du5ug'><center id='du5ug'></center></pre></bdo></b><th id='du5ug'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='du5ug'><tfoot id='du5ug'></tfoot><dl id='du5ug'><fieldset id='du5ug'></fieldset></dl></div>

                  本文介紹了創(chuàng)建具有設(shè)定時區(qū)的日期而不使用字符串表示的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我有一個網(wǎng)頁,其中包含日、月和年的三個下拉菜單.如果我使用接受數(shù)字的 JavaScript Date 構(gòu)造函數(shù),那么我將獲得當(dāng)前時區(qū)的 Date 對象:

                  I have a web page with three dropdowns for day, month and year. If I use the JavaScript Date constructor that takes numbers, then I get a Date object for my current timezone:

                  new Date(xiYear, xiMonth, xiDate)
                  

                  給出正確的日期,但由于夏令時,它認為日期是 GMT+01:00.

                  Give the correct date, but it thinks that date is GMT+01:00 due to daylight savings time.

                  這里的問題是,然后我將此 Date 傳遞給 Ajax 方法,當(dāng)日期在服務(wù)器上被反序列化時,它已被轉(zhuǎn)換為 GMT,因此丟失了一個小時,從而將日期向后移動一.現(xiàn)在我可以將日、月和年單獨傳遞到 Ajax 方法中,但似乎應(yīng)該有更好的方法.

                  The problem here is that I then pass this Date to an Ajax method and when the date is deserialised on the server it has been converted to GMT and so lost an hour which moves the day back by one. Now I could just pass the day, month, and year individually into the Ajax method, but it seems that there ought to be a better way.

                  接受的答案為我指明了正確的方向,但是僅使用 setUTCHours() 本身就發(fā)生了變化:

                  The accepted answer pointed me in the right direction, however just using setUTCHours() by itself changed:

                  Apr 5th 00:00 GMT+01:00 
                  

                  Apr 4th 23:00 GMT+01:00
                  

                  然后我還必須設(shè)置 UTC 日期、月份和年份以結(jié)束

                  I then also had to set the UTC date, month and year to end up with

                  Apr 5th 01:00 GMT+01:00
                  

                  這正是我想要的.

                  推薦答案

                  使用 .setUTCHours() 可以在 UTC-time 中實際設(shè)置日期,這將允許您使用 UTC-整個系統(tǒng)的時間.

                  using .setUTCHours() it would be possible to actually set dates in UTC-time, which would allow you to use UTC-times throughout the system.

                  你不能在構(gòu)造函數(shù)中使用 UTC 設(shè)置它,除非你指定一個日期字符串.

                  使用 new Date(Date.UTC(year, month, day, hour, minute, second)) 您可以從特定的 UTC 時間創(chuàng)建 Date-object.

                  Using new Date(Date.UTC(year, month, day, hour, minute, second)) you can create a Date-object from a specific UTC time.

                  這篇關(guān)于創(chuàng)建具有設(shè)定時區(qū)的日期而不使用字符串表示的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調(diào)用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調(diào)用完成)
                  JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標頭) - IT屋-程序員軟件開發(fā)技術(shù)分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                  NETWORK_ERROR: XMLHttpRequest Exception 101(NETWORK_ERROR:XMLHttpRequest 異常 101)
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內(nèi)容)
                  1. <small id='TLiH5'></small><noframes id='TLiH5'>

                  2. <legend id='TLiH5'><style id='TLiH5'><dir id='TLiH5'><q id='TLiH5'></q></dir></style></legend>
                    <tfoot id='TLiH5'></tfoot>

                          <i id='TLiH5'><tr id='TLiH5'><dt id='TLiH5'><q id='TLiH5'><span id='TLiH5'><b id='TLiH5'><form id='TLiH5'><ins id='TLiH5'></ins><ul id='TLiH5'></ul><sub id='TLiH5'></sub></form><legend id='TLiH5'></legend><bdo id='TLiH5'><pre id='TLiH5'><center id='TLiH5'></center></pre></bdo></b><th id='TLiH5'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='TLiH5'><tfoot id='TLiH5'></tfoot><dl id='TLiH5'><fieldset id='TLiH5'></fieldset></dl></div>

                            <tbody id='TLiH5'></tbody>
                            <bdo id='TLiH5'></bdo><ul id='TLiH5'></ul>

                            主站蜘蛛池模板: 日韩在线中文字幕 | 欧区一欧区二欧区三免费 | 亚洲精彩免费视频 | 日本精品一区二区三区在线观看 | 美女天天操 | av性色全交蜜桃成熟时 | 精品一区二区在线视频 | 日韩成人在线电影 | 国产成人99久久亚洲综合精品 | 亚洲精品专区 | 97免费在线观看视频 | 免费精品视频在线观看 | www免费视频 | 国产黄色在线观看 | 一区二区三区欧美 | 欧美综合一区二区 | 精品久久久久久亚洲精品 | 黄色片在线观看网址 | 狠狠躁夜夜躁人人爽天天高潮 | 国产激情一区二区三区 | 日韩精品视频在线免费观看 | 久久伊人免费视频 | 中日av| 91久久国产综合久久 | 亚洲国产成人精品女人久久久 | 色婷婷综合久久久中字幕精品久久 | 国产一区三区视频 | 色女人天堂 | 午夜成人免费视频 | 蜜桃免费av | 精品在线一区 | 精品欧美一区二区三区久久久 | 欧美日韩精品在线一区 | 欧美激情一区二区 | 久草精品在线 | 欧美日韩在线不卡 | 国产一区二区不卡 | 国产精品久久久久一区二区三区 | 国产在线激情视频 | 欧美久久一区二区三区 | 伊人导航|