首页
\
问答
\
Java 8的ZonedDateTime在转换时是否考虑了夏令时?(Does Java 8's ZonedDateTime take into account daylight savings when converting?)
Java 8的ZonedDateTime在转换时是否考虑了夏令时?(Does Java 8's ZonedDateTime take into account daylight savings when converting?)
我有以下代码:
ZonedDateTime zonedDateTime = ZonedDateTime.ofInstant( this.start.toLocalDateTime(), ZoneOffset.UTC, ZoneOffset.systemDefault());
this.start来自java.sql.Timestamp。 我明确地将UTC转换为系统的本地偏移量,这是否足够聪明以考虑夏令时?
I have the following code below:
ZonedDateTime zonedDateTime = ZonedDateTime.ofInstant( this.start.toLocalDateTime(), ZoneOffset.UTC, ZoneOffset.systemDefault());
The this.start is from a java.sql.Timestamp. I am explicitly converting from UTC here to the system's local offset, will this be smarty enough to take into account daylight savings?
原文:https://stackoverflow.com/questions/43329838
更新时间:2022-02-16 17:02
最满意答案
按
Tag
分组from r in db.Tags join o in db.Ops on r.OpId equals o.OpId group o by r.Tag into ops select ops
按标签过滤以获取您正在寻找的Ops
What I needed is this search, this will bring All the Ops that have the same tag in string Query var:
var AllOpsWithTagQuery = from r in db.Tags where(r.Tag.StartsWith(Query)) join o in db.Opportunities on r.OpId equals o.OpId select o;
相关问答
更多-
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
如何为多对多关系编写简单的LINQ报告?(How can I write a simple LINQ report for a many to many relationship?)[2022-11-20]
正如您所说,您无法控制域类 - 它们属于Microsoft。 所以,你真正说的是你不想直接将你的域名对象暴露给世界其他地方(google那个,你会发现各种各样的人对这个主题有意见)。 因此,一个选项是定义一组类,这些类是您要公开的类(数据交换类)。 就像是: public class User { public string Id { get; set; } public string UserName { get; set; } public virtual ListRol ... -
希望这会起作用: var userContactList = (from custGroup in _db.CustomerGroup join cList in _db.Contact_List on custGroup.Customer_Code equals cList.Customer_Code select new Co ...
-
你可以写下两行。 var customer = db.Customers.First(c => c.Id == activity.CustomerId); var customerName = customer.Name; 进一步编写扩展方法 static Customer GetCustomer(this Activity) { return db.Customers.First(c => c.Id == activity.CustomerId); } 并使用像 activity.GetCus ...
-
如果您使用Code First进行多对多关系,请不要自己创建JITTTION TABLE! Code First将为您完成,您将获得导航属性,解决您的问题。 它将解决您的问题,而不是操纵这些对象的问题..... 首先更改模型,生成数据库,查看Code First如何创建第3个“联结”表,然后查看如何在代码中使用它。 如果它没有用,请告诉我。 If you are using Code First for a many to many relationship, DO NOT CREATE THE JUNCT ...
-
LINQ to Entities删除多对多关系中的所有条目(LINQ to Entities delete all entries in many-to-many relationship)[2022-05-07]
如果您不喜欢执行像Paperjam建议的商店命令,您也可以为此创建存储过程。 这很好地映射到ObjectContext上的静态类型函数。 If you don't like executing a store command like Paperjam suggested you could also create a stored procedure for this. That would nicely map to a static typed function on your ObjectConte ... -
LINQ到实体关系(LINQ to Entity Relationship)[2021-06-17]
您可以尝试从链接查询中提取您的函数: int categoryTypeId = getCategoryTypeID(selectedId); var categories = db.DataModel.Categories .Where(c => c.CategoryTypeID == categoryTypeId); You can try pulling your function out of the link query: int categoryTypeId = getCategory ... -
Linq在1对多关系中的2个类之间的表达式(Expression for Linq between 2 classes in a 1 to many relationship)[2023-07-27]
按Tag分组 from r in db.Tags join o in db.Ops on r.OpId equals o.OpId group o by r.Tag into ops select ops 按标签过滤以获取您正在寻找的Ops What I needed is this search, this will bring All the Ops that have the same tag in string Query var: var AllOpsWithTagQuery = from r ... -
您在示例中所做的是找到任何第一个具有Id: 3 Student Document Id: 3 。 最终没有。 你想要做的是: var result = listDocs.Where(doc => doc.Students.Any(st => st.Id == 3).ToList(); 它将评估至少有一个Id: 3为1的Student Document 。 What you did in your example was finding any Document that has first Student ...
-
听起来您可能会对新的Reactive Framework感兴趣: Rx是一个使用可观察集合组成异步和基于事件的程序的库。 It sounds like the new Reactive Framework may be of interest to you: Rx is a library for composing asynchronous and event-based programs using observable collections.