473,513 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ISO Date Functions

I need the following functions using the standards for Week Numbering IE
Week one is the first week with a thursday in it.

getWeekStartDate( WeekNum as Integer , YearNumber as Integer ) as Date
getWeekEndDate ( WeekNum as Integer , YearNumber as Integer ) as Date
getWeekNumber ( dateToCheck as Date ) as Integer
numWeeksInYear( year as Integer ) as Integer

Does anyone know if there are these functions ?

Cheers -

Jan 6 '06 #1
1 1996
here is the basis

Function getWeek1Monday(ByVal year As Integer) As Date

Dim Jan1st As Date = New Date(year.ToString, 1, 1)

If Jan1st.DayOfWeek <= DayOfWeek.Thursday Then

Return DateAndTime.DateAdd(DateInterval.Day, 1 - Jan1st.DayOfWeek, Jan1st)

Else

Return DateAndTime.DateAdd(DateInterval.Day, 8 - Jan1st.DayOfWeek, Jan1st)

End If

End Function
--
Best Regards

The Inimitable Mr Newbie º¿º
"Newbie" <me@me.com> wrote in message
news:uE**************@TK2MSFTNGP15.phx.gbl...
I need the following functions using the standards for Week Numbering IE
Week one is the first week with a thursday in it.

getWeekStartDate( WeekNum as Integer , YearNumber as Integer ) as Date
getWeekEndDate ( WeekNum as Integer , YearNumber as Integer ) as Date
getWeekNumber ( dateToCheck as Date ) as Integer
numWeeksInYear( year as Integer ) as Integer

Does anyone know if there are these functions ?

Cheers -


Jan 6 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
5006
by: ndsoumah | last post by:
Hi guys I'm having a hard time trying to validate some dates. I have a form that accept dates from users in this format (YYYY-mm-dd). I've been looking at the available datetime functions and...
8
9425
by: Gerrit Holl | last post by:
Posted with permission from the author. I have some comments on this PEP, see the (coming) followup to this message. PEP: 321 Title: Date/Time Parsing and Formatting Version: $Revision: 1.3 $...
2
2494
by: Noozer | last post by:
I have a textbox on one of my forms that is used to accept a time from the user. I need to write this value to a database to trigger an event later on. What I'd like to know is... Are there...
3
23798
by: usenet | last post by:
I have inherited a table where date information was saved from PHP as a VARCHAR. (Sigh.) This means that the so-called date fields look like this : August 1, 2005, 9:09 am EDT October 13, 2004,...
4
4762
by: Ekong, Samuel Akpan | last post by:
Hi, I am parsing a binary file and intend to read a date(not time) field encoded thus: 0xA1290B(little-endian). Now I know the date to be 12/04/2003 but just cannot get any of the known datetime...
12
29423
by: Assimalyst | last post by:
Hi, I have a working script that converts a dd/mm/yyyy text box date entry to yyyy/mm/dd and compares it to the current date, giving an error through an asp.net custom validator, it is as...
30
5646
by: fniles | last post by:
On my machine in the office I change the computer setting to English (UK) so the date format is dd/mm/yyyy instead of mm/dd/yyyy for US. This problem happens in either Access or SQL Server. In the...
9
2905
by: Martin | last post by:
I'm retrieving some records from a database. One of the fields contains a date/time. I would like to format it as I send it out to the table in the displayed page. Can some one please tell me...
8
1805
by: MLH | last post by:
Sometimes it works and sometimes it crashes. If I want "Today is " & Date$ & "." to appear in a query field, why might it work sometimes and not others? Would I be better to call a FN? Say,...
0
16475
yasirmturk
by: yasirmturk | last post by:
Standard Date and Time Functions The essential date and time functions that every SQL Server database should have to ensure that you can easily manipulate dates and times without the need for any...
0
7265
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7171
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7545
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7111
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7539
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5692
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3240
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1605
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.