Hello Multicharts Support,
When I use StringToDate("01/03/1977") it returns 28128.00
When I use DateToJulian(28128.00) it returns 1002.00
When I use JulianToDate(1002.00) it returns 20928.00
When I use DateToString(20928.00) it returns 4/18/1957
Is this a bug or do I not understand how to convert dates?
Thank you for your Time
EK
Date, String and Julian Conversion problems
-
- Posts: 10
- Joined: 17 Nov 2005
- Has thanked: 2 times
Re: Date, String and Julian Conversion problems
I never use them but I would assume you use the corresponding format to add or subtract dates. After the addition/subtraction of the number version you convert it back.
-
- Posts: 10
- Joined: 17 Nov 2005
- Has thanked: 2 times
Re: Date, String and Julian Conversion problems
Hello Bowlesj3,
Thanks for taking the time to respond to my query
I am not adding nor subtracting anything
I am just trying to convert a string date to date then date to a Julian date and then back.
It should convert back to the same date right, but it doesn't.
Thanks
EK
Thanks for taking the time to respond to my query
I am not adding nor subtracting anything
I am just trying to convert a string date to date then date to a Julian date and then back.
It should convert back to the same date right, but it doesn't.
Thanks
EK
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Date, String and Julian Conversion problems
does 28128.00 look like a date to you?Hello Multicharts Support,
When I use StringToDate("01/03/1977") it returns 28128.00
...
Thank you for your Time
EK
hint: the answer is in the manual.
-
- Posts: 10
- Joined: 17 Nov 2005
- Has thanked: 2 times
Re: Date, String and Julian Conversion problems
Hello TJ,
Thanks for responding to my post.
to answer your question yes,
Example
StringToDate("01/01/2008") will return a value of 39448.00000000, corresponding to the specified date of January 1st, 2008
StringToDate("04/04/99") will return a value of 36254.00000000, corresponding to the specified date of April 4th, 1999
so 28128.00 to me does look like a date
Am I missing something?
Thanks
EK
Thanks for responding to my post.
to answer your question yes,
Example
StringToDate("01/01/2008") will return a value of 39448.00000000, corresponding to the specified date of January 1st, 2008
StringToDate("04/04/99") will return a value of 36254.00000000, corresponding to the specified date of April 4th, 1999
so 28128.00 to me does look like a date
Am I missing something?
Thanks
EK
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Date, String and Julian Conversion problems
the keyword is deceptive. (I know, blame it on EL)Hello TJ,
Thanks for responding to my post.
to answer your question yes,
Example
StringToDate("01/01/2008") will return a value of 39448.00000000, corresponding to the specified date of January 1st, 2008
StringToDate("04/04/99") will return a value of 36254.00000000, corresponding to the specified date of April 4th, 1999
so 28128.00 to me does look like a date
Am I missing something?
Thanks
EK
Here's what's in the [F1] help:
StringToDate
Returns the integer portion of a double-precision decimal DateTime value, corresponding to the specified date.
This is not a date per se.
You are getting a DateTime value,
ie. a serial number of the date/time.
28128.00 refers to the 28,128th day since 1900.
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Date, String and Julian Conversion problems
the "Date" in DateToJulian is NOT the same "Date" as in StringToDate.Hello Multicharts Support,
...
When I use DateToJulian(28128.00) it returns 1002.00
...
Is this a bug or do I not understand how to convert dates?
Thank you for your Time
EK
again, from the [F1] help:
DateToJulian
...
The date is specified in the YYYMMdd format, where YYY is the number of years since 1900, MM is the month, and dd is the day of the month.
-
- Posts: 10
- Joined: 17 Nov 2005
- Has thanked: 2 times
Re: Date, String and Julian Conversion problems
For future readers of this thread, this MC WIKI page provided much of the information I needed.
https://www.multicharts.com/trading-sof ... syLanguage
https://www.multicharts.com/trading-sof ... syLanguage