Magnus1982
Registered User.
- Local time
- Today, 00:33
- Joined
- Apr 29, 2017
- Messages
- 41
Hello
I am looking way to display in text box day of year .
I am using :
Dim iDayNumber As Integer
Dim dt As Date: dt = Date
iDayNumber = DateDiff("d", CDate("1/1/" & Year(dt)), dt) + 1
I have two problems:
1. If day in year is below 100 i have for example 89 or 7 I need to have 089 or 007.
2. Code need to count all the time base on 366days (leap-year) and should do not take into account an ordinary year.
Somebody know how to do that ?
I am looking way to display in text box day of year .
I am using :
Dim iDayNumber As Integer
Dim dt As Date: dt = Date
iDayNumber = DateDiff("d", CDate("1/1/" & Year(dt)), dt) + 1
I have two problems:
1. If day in year is below 100 i have for example 89 or 7 I need to have 089 or 007.
2. Code need to count all the time base on 366days (leap-year) and should do not take into account an ordinary year.
Somebody know how to do that ?