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
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
TCollection wiki entry
by
Thaddy
[
Today
at 05:44:53 am]
I have made some progress...
by
onionmixer
[
Today
at 04:17:27 am]
New, Pascal-like programm...
by
nvitya
[
Today
at 02:37:18 am]
TDateTimePicker - Make th...
by
wp
[
Today
at 12:59:57 am]
equivalent to C/C++ "offs...
by
creaothceann
[
Today
at 12:50:49 am]
UI app to work with SQLit...
by
LeP
[
Today
at 12:50:04 am]
Elite Arcade
by
Guva
[July 11, 2026, 11:25:29 pm]
Freepascal
by
marcelomaurinmartins@gmai
[July 11, 2026, 11:24:44 pm]
International Pascal Cong...
by
vincococka
[July 11, 2026, 11:18:49 pm]
Printing on HP Smart Tank
by
JerryHudson
[July 11, 2026, 10:22:12 pm]
Help needed on how to do ...
by
cdbc
[July 11, 2026, 08:38:38 pm]
Why is my program freezin...
by
paweld
[July 11, 2026, 07:19:46 pm]
is there PDS reader/expor...
by
jamie
[July 11, 2026, 07:01:12 pm]
Fpcupdeluxe
by
cdbc
[July 11, 2026, 06:40:29 pm]
weird error message
by
jamie
[July 11, 2026, 06:37:01 pm]
Como compilar uma lib par...
by
marcelomaurinmartins@gmai
[July 11, 2026, 06:24:51 pm]
Desenvolvimento visual pa...
by
marcelomaurinmartins@gmai
[July 11, 2026, 06:19:16 pm]
OpenDocument('Filename') ...
by
J-G
[July 11, 2026, 06:13:03 pm]
TTL Record Count, i.e. a ...
by
1HuntnMan
[July 11, 2026, 06:05:29 pm]
Using callback
by
LemonParty
[July 11, 2026, 05:43:15 pm]
Source Editor Collapsed P...
by
J-G
[July 11, 2026, 11:17:14 am]
Habari STOMP Clients for ...
by
mjustin
[July 11, 2026, 11:15:54 am]
Questions on slight diffe...
by
egsuh
[July 11, 2026, 09:45:30 am]
Have anybody used Horse f...
by
egsuh
[July 11, 2026, 08:31:21 am]
Problems with creating a ...
by
jamie
[July 11, 2026, 12:10:44 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED]algorithm find day name (Read 4446 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: 28
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: 13625
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: 19388
Glad to be alive.
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
objects are fine constructs. You can even initialize them with constructors.
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