当前位置:网站首页>Convert datetime string to datetime - C in the original time zone

Convert datetime string to datetime - C in the original time zone

2022-07-04 07:51:00 45MA

I have a timestamp in the following format :

20110316 11:03:22.276919 -0400s

By the way , Does anyone know what the end of this date and time is ?

I try to convert this to... In the time zone from which it originally came datetime object . But perform the following conversion :

DateTime.ParseExact(source, "yyyyMMdd HH:mm:ss.FFFFFF zzzz\\s", CultureInfo.CurrentCulture)

Automatically convert it to my local time zone .

My expected date and time is my date and time in the morning 11:03, But because my time zone is later than the timestamp 2 Hours , Therefore, the conversion return time is in the morning 9:03. In addition to performing string truncation to ignore the time zone , There is another way to parse the date , At the same time, keep it in its time zone ?

Reference plan

Use DateTimeOffset

DateTimeOffset dto = DateTimeOffset.ParseExact("20110316 11:03:22.276919 -0400s", @"yyyyMMdd HH\:mm\:ss\.FFFFFF zzz\s", null);Console.WriteLine(dto.DateTime);

When the reply is sometimes an object and sometimes an array , How to analyze when using transformation JSON reply ? - java

I am using Retrofit To get JSON reply . This is part of my implementation [email protected]("/api/report/list") Observable<Bills> listBill(@Query("employee_id") String employeeID); The bill category is -public static class…

Transformation is returning an empty response body - java

I'm trying to use Retrofit and Gson Analyze some JSON. however , The response organization I got is empty . When I try to print information from an object , appear NullPointerException. I make sure URL correct , And I also make sure POJO It's also true . I am using jsonschema2pojo To help create POJO class . This is what I want to analyze JSON{ "?xml": { "@versi…

json Array , among in The array returned an error ? Bad string - javascript

I will json The string file resolves to python, And always back error. I used online json Formatter and verifier , They also return errors , So I need help to make my json Right and tell me wrong [{ "sentence_id": "TR.00001", "sentence": { "text": …

Add line breaks after merging each file - python

I have many similar to the following JSON file : for example .1.json{"name": "one", "description": "testDescription...", "comment": ""} test.json{"name"…

Json To php,json_decode return NULL - php

I'm using PHP Conduct JSON Some of the parser API, Used to store information about heritage . I encountered a problem in parsing , Because it returns NULL Values instead of arrays or objects . ordinary JSON The code can be parsed well , But it can be :{"success":true,"totalCount":1,"data":[{"id":99694…

原网站

版权声明
本文为[45MA]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202141517542953.html