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
Debian removes FPC/Lazaru...
by
Thaddy
[
Today
at 10:43:02 am]
Qt6/Wayland clipboard: pa...
by
Thaddy
[
Today
at 10:31:58 am]
Questions about TFuncSeri...
by
hedgehog
[
Today
at 09:50:46 am]
CADSys4 3D.
by
creaothceann
[
Today
at 09:34:10 am]
Need help with project ma...
by
bobihot
[
Today
at 08:44:13 am]
macOS 14+ Install Instruc...
by
CM630
[
Today
at 07:56:45 am]
class not found
by
cdbc
[
Today
at 07:40:10 am]
ShortStrings vs long stri...
by
Khrys
[
Today
at 07:39:21 am]
Any way to "embed" Window...
by
egsuh
[
Today
at 05:13:50 am]
Update a table with an Au...
by
CraigC
[March 10, 2026, 10:54:23 pm]
TSplitter color property ...
by
backprop
[March 10, 2026, 08:43:28 pm]
Z80 ZX Spectrum and Syste...
by
Cascade
[March 10, 2026, 08:22:14 pm]
could Ardour's YTK be use...
by
robert rozee
[March 10, 2026, 03:18:36 pm]
Synchronizing Lazarus pro...
by
Martin_fr
[March 10, 2026, 03:18:18 pm]
[revisited] triple click
by
Thaddy
[March 10, 2026, 01:08:40 pm]
Hello! Anything new?
by
JuhaManninen
[March 10, 2026, 11:22:16 am]
C/C++ code to Object Pasc...
by
domasz
[March 10, 2026, 10:44:20 am]
[Solved] Saving a workboo...
by
Kaljakoira
[March 10, 2026, 09:09:59 am]
Pipewire API
by
Thausand
[March 10, 2026, 07:38:06 am]
Good GPU accelerated math...
by
myisjwj
[March 10, 2026, 03:17:06 am]
REST Server/Client, how t...
by
valdir.marcos
[March 09, 2026, 10:18:36 pm]
TSpeedButton qt6 styleshe...
by
dsiders
[March 09, 2026, 09:40:21 pm]
Purpose of TProcessUTF8
by
Thaddy
[March 09, 2026, 09:08:03 pm]
How to remove consoleApp ...
by
Thaddy
[March 09, 2026, 08:51:40 pm]
Fast Canvas Library V1.05...
by
Gigatron
[March 09, 2026, 08:32:15 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED]algorithm find day name (Read 4361 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: 13412
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: 18785
To Europe: simply sell USA bonds: dollar collapses
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
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...
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