Recent

Author Topic: To get YEAR  (Read 11627 times)

asdf

  • Sr. Member
  • ****
  • Posts: 310
To get YEAR
« on: February 07, 2011, 12:09:59 pm »
MonthOfTheYear gives the month.

And how can I get the year from a TDateTime var  :( ?
Lazarus 1.2.4 / Win 32 / THAILAND

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: To get YEAR
« Reply #1 on: February 07, 2011, 12:14:58 pm »
http://www.freepascal.org/docs-html/rtl/dateutils/index-5.html
What can you think of from the list above? ;)

asdf

  • Sr. Member
  • ****
  • Posts: 310
Re: To get YEAR
« Reply #2 on: February 07, 2011, 01:25:41 pm »
I've saved this URL in Favorites with great thanks  :) .
Lazarus 1.2.4 / Win 32 / THAILAND

captian jaster

  • Guest
Re: To get YEAR
« Reply #3 on: February 07, 2011, 07:22:30 pm »
i could never get dateutils working.
I just use sysutils

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: To get YEAR
« Reply #4 on: February 08, 2011, 02:40:51 am »
Quote
i could never get dateutils working.
I just use sysutils
What's wrong? DateUtils is aware of your OS localization (it affects date format, separator, etc), perhaps that's your problem.

asdf

  • Sr. Member
  • ****
  • Posts: 310
Re: To get YEAR
« Reply #5 on: February 08, 2011, 08:13:44 pm »
I've never used Delphi before,
do they have YearOf function ?

I'm really so happy with such function on my accounting project,
date, month and year are important.
« Last Edit: February 08, 2011, 08:16:26 pm by asdf »
Lazarus 1.2.4 / Win 32 / THAILAND

captian jaster

  • Guest
Re: To get YEAR
« Reply #6 on: February 08, 2011, 08:21:39 pm »
Quote
i could never get dateutils working.
I just use sysutils
What's wrong? DateUtils is aware of your OS localization (it affects date format, separator, etc), perhaps that's your problem.
If I put DateUtils and try to use something like "Now" it won't find it.
But it finds it through Sysutils.. Its fine since I use that all the time ^_^

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: To get YEAR
« Reply #7 on: February 09, 2011, 05:55:54 am »
Quote
I've never used Delphi before,
do they have YearOf function ?
Same here, but AFAIK RTL units are mostly Delphi compatible and things like this should probably exists in Delphi as well.
Quote
If I put DateUtils and try to use something like "Now" it won't find it.
But it finds it through Sysutils.. Its fine since I use that all the time ^_^
Of course, Now function is defined in SysUtils, not DateUtils.

 

TinyPortal © 2005-2018