iso8601

Get week number using date in python

◇◆丶佛笑我妖孽 提交于 2019-12-06 08:17:14
Date is datetime.date(2013, 12, 30) I am trying to get week number using import datetime datetime.date(2013, 12, 30).isocalendar()[1] I am getting output as , 1 Why i am not getting week number of last year , instead i am getting week number of current year? Whats wrong i am doing here ? You are doing nothing wrong, 2013/12/30 falls in week 1 of 2014, according to the ISO8601 week numbering standard : The ISO 8601 definition for week 01 is the week with the year's first Thursday in it. The Thursday in that week is 2014/01/02. Other ways to explain the definition, from the same linked WikiPedia

Writing a weekly recurring time interval (ISO 8601)

社会主义新天地 提交于 2019-12-06 05:55:44
i need a correct weekly ISO 8601 recurring time interval . For example, repeat: Each Monday, 19:00. I already tried a lot of examples, but nothing worked correctly :-( Thx for any help! R/2014-W01-1T19:00:00/P1W Represents a unbounded recurrence with a start date and a duration of one week. The recurrence starts at the first day (Monday) of the week number 01 in the week year 2014. I have used a week date , but you can substitute it with a calendar date or ordinal date , just make sure the date falls on a Monday. 来源: https://stackoverflow.com/questions/20920065/writing-a-weekly-recurring-time

Ebay API ISO 8601 duration format to timestamp

随声附和 提交于 2019-12-06 01:51:00
Ebay API provides me time in ISO 8601. For example, it gives me item time left: P0DT0H1M4S Here is how this time is formatted: ebay duration I want to convert this time to simple Y-m-d H:i:s format. So far I've tried date("Y-m-d", strtotime("P0DT0H1M4S")); but it does not work. That date interval string is an ISO 8601 duration specification and can be use with DateTime() and DateInterval() $date = new DateTime(); $date->add(new DateInterval('P0DT0H1M4S')); echo $date->format('Y-m-d H:i:s'); or as a one-liner (PHP 5.4+) echo (new DateTime())->add(new DateInterval('P0DT0H1M4S'))->format('Y-m-d H

Set default database DateFormat to ISO 8601 with timezones in Laravel

自古美人都是妖i 提交于 2019-12-05 10:15:34
I think the title says it: I want to use ISO 8601 with timezones as default DateTime-Format in Laravels Eloquent. I got this class mEloquent extends Eloquent { protected function getDateFormat() { return 'YYYY-MM-DDThh:mm:ss.sTZD'; } } All my models will extend mEloquent. But how should I build the tables? Just <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; class CreateUsersTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('users', function(Blueprint $table) { $table->increments('id');

VBScript ISO8601

一世执手 提交于 2019-12-05 09:14:31
In VBScript, does FormatDateTime have ISO 8601 support? If not, how would I write such function with it? For example: Response.Write FormatAsISO8601(#05/04/2011#) Function FormatAsISO8601(datetime) ... End Function Alon Gubkin Here is the specific code I needed from Chris' class, a bit more optimized: Public Function ToIsoDateTime(datetime) ToIsoDateTime = ToIsoDate(datetime) & "T" & ToIsoTime(datetime) & CurrentTimezone End Function Public Function ToIsoDate(datetime) ToIsoDate = CStr(Year(datetime)) & "-" & StrN2(Month(datetime)) & "-" & StrN2(Day(datetime)) End Function Public Function

Getting missmatch in datetime format using jms serializer and ISO8601

十年热恋 提交于 2019-12-05 07:21:24
I am getting this message: Invalid datetime "2017-11-07T19:46:57.118Z", expected format Y-m-d\\TH:i:sP. When using JMS Serializer and the config: jms_serializer: handlers: datetime: default_format: 'Y-m-d\\TH:i:sP' I think that my supplied date is in the correct format, but apparently not. Is it something that is wrong with the date? This is a tough one, I've run into it before. I was using annotations so my fix looked like: @Serializer\Type("DateTime<'Y-m-d\TH:i:s.uT'>") So I'm guessing yours is going to look like: jms_serializer: handlers: datetime: default_format: 'Y-m-d\TH:i:s.uT' Or you

RFC822 Timezone Parsing in Java

时光怂恿深爱的人放手 提交于 2019-12-05 03:05:35
I have a JS date that is being converted by Dojo into RFC822 format. The function call - dojo.date.toRfc3339(jsDate), generates the following date - 2007-02-26T20:15:00+02:00. I have an application that uses a Java date SimpleDateFormat to parse in the dates generated above. I am having problems parsing this date format due to the timezone. I have attempted to use yyyy-mm-DD'T'hh:mm:ssZ This fails as the 'Z' for timezone doesn't expect a ':' character. Does anyone know how I would specify a pattern to handle a RFC822 date with the ':'? revision: Thanks for correctly interpreting what I am

Representing Fraction of Second with ISO 8601:2004

老子叫甜甜 提交于 2019-12-05 01:48:57
问题 The following is the definition of IS0 8601:2004 standard. It says that the fraction of second can be represented with one to six digits. Can I use all the 6 digits for representing the fraction of a second? Are the following Representation correct, if I use 6 digits for representing fraction of a second? 1ms -- 001000 10ms -- 010000 100ms -- 100000 {Extended Time Format} (32 bytes) YYYY-MM-DDThh:mm:ss.sTZD YYYY = Year 0000 to 9999 MM = Month 01 to 12 DD = Day 01 to 31 T = special separator T

Parsing ISO8601 date/time with DateTime struct

怎甘沉沦 提交于 2019-12-04 16:59:30
I am trying to parse an ISO8601 formatted date/time string with .NET's DateTime structure. In order for me to give a full underdstanding of the problem, I am going to perform tests using both .NET and JavaScript. I am currently in Britain (British Summer Time, which is UTC+01:00). My understanding of ISO8601 is that: When the string is suffixed with "Z", the time is expressed in UTC. When the string is suffixed with "+/-hh:mm", the time is expressed in Local time, where the "+/-hh:mm" expresses the offset from UTC. Consider the following ISO8601 date/time format string: "1987-01-05T08:45:30

How to get JSON.NET to serialize date/time to ISO 8601?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 10:22:25
问题 I have a Web API application that returns JSON to consumers who may not be using Microsoft technologies. When my controller returns an object with DateTime properties as JSON, it serializes the date in this format: 2017-03-15T00:00:00-04:00 This is giving the consumer a bit of a headache as they're expect it to be in ISO 8601 format. Some research has told me that JSON.NET now uses ISO 8601 by default (I am using 9.0.1). When I run this code... Clipboard.Copy(JsonConvert.SerializeObject