在Android棉花糖的工具栏顶部的空白栏(Blank bar at top of toolbar in Android Marshmallow)
仅在Android MarshMallow版本的工具栏顶部有一个空白条。 所有其他Android版本都设置为正确显示。
Got an empty white bar at the top of toolbar only in Android MarshMallow Versions. All other android versions are set to display correctly.
原文:https://stackoverflow.com/questions/38455396
最满意答案
你很困惑。 首先,美国东部时区的夏令时是-4,而不是-5。 晚上9:55肯定是凌晨2:55前5小时; 下午10:55将是4个小时前。
有可能“EST”正好给你:东部标准时间而不考虑夏令时。 “EST5EDT”可能会给你你想要的时区,虽然(假设设备使用zoneinfo作为模拟器),“America / New_York”将是首选。
You are very confused. To start with, daylight savings time in the US Eastern time zone is -4, not -5. 9:55 PM certainly is 5 hours before 2:55 am; 10:55 PM would be 4 hours before.
Chances are that "EST" is giving you exactly that: Eastern Standard Time without regard for daylight savings time. "EST5EDT" might give you the time zone you are expecting, although (assuming the device uses zoneinfo as the simulator does) "America/New_York" would be preferred.
相关问答
更多-
Python夏令时(Python daylight savings time)[2022-06-18]
您可以使用time.localtime并查看返回值中的tm_isdst标志。 >>> import time >>> time.localtime() (2010, 5, 21, 21, 48, 51, 4, 141, 0) >>> _.tm_isdst 0 使用time.localtime() ,您可以在任意时间询问同一个问题,以查看DST是否对当前时区有效(或有效)。 You can use time.localtime and look at the tm_isdst flag in the ret ... -
您无法在JVM中关闭夏令时。 每个时区都使用偏移量进行编码,以及是否应用夏令时(如果是,则在几个日期之间)。 您可以通过以下方式检查: TimeZone.getDefault().useDaylightTime(); TimeZone.getDefault().inDaylightTime( new Date() ); 但是,您可以使用TZUpdater工具更新JDK安装中的时区文件: http://www.oracle.com/technetwork/java/javase/downloads/tzup ...
-
计算夏令时和非夏令时之间的时差(Calculate time differences between daylight saving time and non-daylight saving time)[2023-03-28]
由于EST你有问题。 来自?timezone : 请注意,其中一些名称可能与您的预期不符:特别是EST是加拿大使用的时区,没有夏令时...... 使用US/Eastern或America/New_York代替EST 。 请参阅?OlsonNames()以获取更多信息。 #DST x1 = as.POSIXct("22/5/2016 23:50", format = "%d/%m/%Y %H:%M", tz = "America/New_York") x2 = as.POSIXct("22/5/2016 23 ... -
你很困惑。 首先,美国东部时区的夏令时是-4,而不是-5。 晚上9:55肯定是凌晨2:55前5小时; 下午10:55将是4个小时前。 有可能“EST”正好给你:东部标准时间而不考虑夏令时。 “EST5EDT”可能会给你你想要的时区,虽然(假设设备使用zoneinfo作为模拟器),“America / New_York”将是首选。 You are very confused. To start with, daylight savings time in the US Eastern time zone is ...
-
您可以使用如下所示的NSTimeZone方法进行夏令时:请参阅NSTimeZone类参考 isDaylightSavingTimeForDate: //将告诉您此日期是否存在日光节约 daylightSavingTimeOffset //将告诉您夏令时的偏移量 使用下面的代码,它可以正确地返回日光保存和偏移 var timeZone:NSTimeZone = NSTimeZone(name:"Europe/London")! print(timeZone.daylightSavingTime) //this ...
-
NSDate对象固有地存储为GMT值。 你在这里遇到的问题是你正在使用currentCalendar(目前可能在DST中)和localTimeZone secondsFromGMT进行计算,后者根据一年中的时间进行切换。 这里最好的解决方案是使用GMT的NSCalendar而不是基于移动的时区,如果(如您所示),您希望它们始终为+0000。 或者,您可以更改为使用NSTimeZone secondsFromGMTForDate:它会在相关日期/时间考虑DST。 NSDate objects are inhe ...
-
获得即将到来的夏令时(Get upcoming Daylight Saving date)[2021-06-17]
$date = new DateTime(); $tz = $date->getTimezone(); $changes = $tz->getTransitions(strtotime("yesterday"), strtotime("+1 year")); $n = count($changes); $tnow = time(); for($i = 0; $i < $n; $i++) { if($changes[$i]["ts"] > $tnow) { echo "Upco ... -
这是iOS11中的一个错误。 我提交了一个雷达,它被Apple标记为“DUPLICATE OF 33629367”(从iOS11.1测试版开始仍然是一个开放的问题)。 在大多数情况下,最好停止使用localTimeZone ......这是一个线程噩梦。 事情应该如何运作: [NSTimeZone systemTimeZone]始终返回系统时区。 如果系统时区发生更改,则必须重新查询此方法(返回的NSTimeZone不会自动更新) 除非已设置defaultTimeZone,否则[NSTimeZone def ...
-
我认为这不是一个安全的假设。 在OS X上,在我的时区和区域设置(美国英语,UTC-6)中,我可以运行以下代码: NSTimeZone *utc = [NSTimeZone timeZoneWithName:@"Etc/UTC"]; NSTimeZone *london = [NSTimeZone timeZoneWithName:@"Europe/London"]; NSLog(@"utc name = %@", [utc name]); NSLog(@"london na ...
-
是的, TimeZoneInfo.ConvertTime尽可能地处理夏令时。 但是,请注意,如果您正在使用具有“未指定”类型的DateTime (例如,已从字符串中解析它),这可能在您的源时区中不明确 。 (例如,如果时钟从凌晨2点回到凌晨1点,那么凌晨1点30分在那天发生两次。)对于DateTime.Now应该不是问题,因为“本地”类型实际上可以是“本地的”和更早的模棱两可的时代“或”本地和后来的模糊时代“。 如果您想要更多地控制转换 - 以及拥有更多描述性类型 - 您可能需要查看我的Noda Time库 ...