week-number

Delphi week number function based on system start of week

自闭症网瘾萝莉.ら 提交于 2019-12-12 00:34:18
问题 The DateUtils.WeekOfTheYear function is great but it uses the ISO 8601 standard definition of a week. That is, a week is considered to start on a Monday and end on a Sunday. I need a similar function that determines the week number based on the system setting for the start of the week. Or at least for either a sunday or monday start of week like MySQL's week function. Anyone have such a function? 回答1: If you are only interested in week starting on Sunday instead on Monday you can simply

SQL Server CE: SET DATEFIRST not working

馋奶兔 提交于 2019-12-11 13:57:13
问题 I'm using SQL Server CE for rapid application development purposes and have hit a little snag - it doesn't seem to support changing the start day of the week. What I've tried: SET DATEFIRST 1; which yields: Unrecognized SET statement as a response (both via a query window and through code). I've googled around and can't find anything in the documentation as to whether changing the start date of a week is supported or isn't supported by SQL Server Ce, nor can I find any alternative method of

Week numbers between two dates

扶醉桌前 提交于 2019-12-11 10:50:26
问题 I'm trying to get the week numbers between two dates. For example, between dates 01/01/2016 and 29/02/2016 I should have S01 S02 S03 S04 S05 S06 S07 S08 Is it possible? How can it be done? 回答1: SELECT 'S' || LPAD( LEVEL, 2, '0' ) FROM DUAL CONNECT BY DATE '2016-01-01' + ( LEVEL - 1 ) * 7 <= DATE '2016-02-29'; Output : 'S'||LPAD(LEVEL,2,'0') ---------------------- S01 S02 S03 S04 S05 S06 S07 S08 S09 Update - with months & dates : Note: changed bounds to highlight difference between week number

Match ISO 8601 week-of-year numbers to month-of-year numbers on Windows with German locale

纵饮孤独 提交于 2019-12-11 05:49:35
问题 This is directly related to my question POSIX date from dates in weekly time format. However, in this question I'd like to specifically ask for how to map ISO 8601 week numbers to month of the year numbers. To me, it seems it is not possible and/or involves some non-intuitive hacks (and even these don't really work reliably) and IMO should thus be considered as something that needs to be fixed in base R . Please correct me if I'm wrong, though EDIT: seems like it the issue is closely related

Inconsistency in java date library for week of year

走远了吗. 提交于 2019-12-11 04:24:52
问题 As per https://en.wikipedia.org/wiki/ISO_8601#Week_dates, Weekdays start on Monday. But, from Java, if you try to extract week number in two different ways, two different outputs come if the date is a Sunday. import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; public class TestDate { public static void main(String[] args) throws ParseException { final SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); final SimpleDateFormat

How to get “start date” and “end date” of a week from MYSQL when week number is available?

血红的双手。 提交于 2019-12-11 03:01:17
问题 The week() function of MySql gives number of week from 0-53. I have a weeknumber and I want to have the " start date " and " end date " of the week represented by weeknumber. How can I do that? If there is no way of getting "start date" and "end date" of a week directly, how can I the "start week day" and "end week day" from the week number? I tried to get the first day (Monday) of the week by using the following query:- $currentWeek = 7; for($w = 0; $w <= $currentWeek; $w++) { $actualWeek =

c - Week of year with variable start and anchor days

左心房为你撑大大i 提交于 2019-12-10 22:54:09
问题 Synopsis: I want to find the week number of a given date with variable starting days and variable anchoring days for the week. Full version: I need to calculate the week any given day lands on out of a year, but I need to be able to change what defines a week. Defining a week boils down to two factors: Choosing whether the week goes from Sunday to Saturday or Monday to Sunday. Choosing what day anchors a week. The start and end of the week is self-explanatory, it simply will decide which

jQuery: week of year script acting up

六月ゝ 毕业季﹏ 提交于 2019-12-10 22:40:09
问题 A while ago I needed a script to update some content every week, and my question was answered in this forum. -- Now, and I'm not a jQuery pro like you :), but the "problem" I have is that today (the moment of this post) it's week #52 but the script wasn't working, it wasn't showing the content for week #52, so I changed my HTML to week #53, and it worked. The "problem" is that there's no week #53, so I'm afraid I'm going to have to change my HTML to continue counting for week #54, #56, #57

Is there a way in javascript to create a date object using year & ISO week number?

给你一囗甜甜゛ 提交于 2019-12-10 20:15:47
问题 I am trying to create a google annotated timeline viz. For that I need to input the date of the event. The only information I have is the year & the ISO week number for the event. Is there a way in Javascript to create a Date object using just the year & week number? I googled it but did not come across any feasible solution. Thanks for the help! 回答1: ISO weeks start on Monday If 1 January is on a Monday, Tuesday, Wednesday or Thursday, it is in week 01. If 1 January is on a Friday, Saturday

Flex, how to get week of year for a date?

允我心安 提交于 2019-12-10 17:18:44
问题 I could not find a method in Flex Date object to get the week of year (1 to 52) What is the best way to find this? Is there any useful library for flex for such date operations like JodaTime in Java. 回答1: I'm not aware of a library, but this function will get you the week index (zero based). function getWeek(date:Date):Number { var days:Array = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; var year:Number = date.fullYearUTC; var isLeap:Boolean = (year % 4 == 0) && (year % 100 != 0) ||