Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
[SOLVED]algorithm find day name
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
WIKI Timeout issues
Please read here if you have trouble connecting to the wiki
Recent
Loading an image from an ...
by
Thaddy
[
Today
at 04:14:46 pm]
IDE Lazarus 4.0 on Window...
by
Martin_fr
[
Today
at 03:47:30 pm]
Build failure
by
cdbc
[
Today
at 02:48:53 pm]
Lazarus 4, What's wrong w...
by
rvk
[
Today
at 02:45:38 pm]
Lazarus 4.0 RC3
by
paxnet_be
[
Today
at 02:34:23 pm]
Firebird 5 remote login v...
by
LacaK
[
Today
at 02:07:34 pm]
CEF component - the first...
by
salvadordf
[
Today
at 12:40:53 pm]
Compile errors in MacBook...
by
Thaddy
[
Today
at 11:46:06 am]
LAMW - UTF-8 character in...
by
Alcatiz
[
Today
at 11:36:29 am]
Layout problem by nested ...
by
Martin_fr
[
Today
at 10:50:30 am]
How to run an external pr...
by
vsajip
[
Today
at 08:50:34 am]
lazbuild command line swi...
by
n7800
[
Today
at 04:21:35 am]
dBGRidController and Erro...
by
essence-ciel
[
Today
at 01:15:11 am]
"LCLVersion" in *.lfm fil...
by
zeljko
[June 17, 2025, 11:05:36 pm]
FPC for high-performance ...
by
Thaddy
[June 17, 2025, 09:42:33 pm]
How to stop macro executi...
by
440bx
[June 17, 2025, 09:19:45 pm]
x86_64-win64 annoys me
by
Nicole
[June 17, 2025, 08:28:16 pm]
OpenDialog and mouse even...
by
Martin_fr
[June 17, 2025, 07:37:19 pm]
InstallAware 2025 Sources...
by
msintle
[June 17, 2025, 06:49:04 pm]
Sqlite & Zeos
by
CharlyTango
[June 17, 2025, 05:01:43 pm]
Strict Aliasing Rule
by
nixbody
[June 17, 2025, 04:19:41 pm]
Lazarus 4 - I give up and...
by
Nicole
[June 17, 2025, 04:01:40 pm]
LazUtils, FileUtil.CopyDi...
by
AlexTP
[June 17, 2025, 02:52:02 pm]
Help needed setting up LA...
by
silvercoder70
[June 17, 2025, 12:12:06 pm]
Font character being clip...
by
Coxy
[June 17, 2025, 12:04:54 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED]algorithm find day name (Read 4113 times)
majid.ebru
Hero Member
Posts: 530
[SOLVED]algorithm find day name
«
on:
May 16, 2017, 10:06:08 pm »
Hi
how can i find name day form date!
is an algorithm to find day name from date!?
for example : today is "Wednesday 2017-05-17 " and what name day is " 2017-
03
-17" or "
2016
-10-22"
«
Last Edit: July 01, 2017, 12:35:34 pm by majid.ebru
»
Logged
SirTwist
New Member
Posts: 21
Re: algorithm find day nam
«
Reply #1 on:
May 16, 2017, 10:15:02 pm »
I do not really understand your question. Perhaps if you write what you expect we can tell you a function or anything else.
Do you want the name of the months? Then it would be
FormatDateTime('mmmm', aDate);
Logged
wp
Hero Member
Posts: 12859
Re: algorithm find day nam
«
Reply #2 on:
May 16, 2017, 10:20:39 pm »
See:
https://www.freepascal.org/docs-html/rtl/sysutils/formatchars.html
Code: Pascal
[Select]
[+]
[-]
WriteLn
(
FormatDateTime
(
'dddddd'
,
now
)
)
;
// ---> Tuesday, May 16 2017
//or:
WriteLn
(
FormatDateTime
(
'dddd'
,
now
)
;
// ---> Tuesday
"Now" returns the current date and time. For any other date use the function EncodeDate():
Code: Pascal
[Select]
[+]
[-]
var
d
:
TDate
;
begin
d
:
=
EncodeDate
(
2017
,
3
,
17
)
;
WriteLn
(
FormatDatetime
(
'dddd'
,
d
)
)
;
«
Last Edit: May 16, 2017, 11:08:16 pm by wp
»
Logged
nummer8
Full Member
Posts: 124
Re: algorithm find day nam
«
Reply #3 on:
May 16, 2017, 10:22:27 pm »
Is the DayOfWeek function from the DateUtils what you need?
function DayOfWeek(DateTime:TDateTime): integer;
Jos
Logged
Thaddy
Hero Member
Posts: 17155
Ceterum censeo Trump esse delendam
Re: algorithm find day nam
«
Reply #4 on:
May 17, 2017, 05:14:13 am »
He asks HOW it is done, not that it already can be done you sillies.
https://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week
Logged
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.
majid.ebru
Hero Member
Posts: 530
Re: algorithm find day name
«
Reply #5 on:
May 17, 2017, 09:05:49 am »
Thanks a lot
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
[SOLVED]algorithm find day name
TinyPortal
© 2005-2018