Autor Beitrag
rolandt4088
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122

WINDOWS XP
Delphi 7, CodeGear RAD Studio
BeitragVerfasst: Mo 13.08.07 11:57 
Hallo,

Folgendes Problem:

Datetimepicker.date - Ausgabe: 13.08.2007

Nun möchte ich die 13, die 08 und die 2007 jeweils in einem eigenen Label ausgegeben lassen.

Ich suche jetzt schon ca. 1 Woche nach einer Lösung.

Vielleicht hat ja jemand eine Idee.

Für die freundliche Hilfe bedanke ich mich.
:?
Gruß
Roland
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mo 13.08.07 11:59 
Mit datetostr in einen String umwandeln und mit Copy und Pos arbeiten (String-Routinen). Findest in der OH einiges dazu (zu Copy u. Pos).

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Heiko
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3169
Erhaltene Danke: 11



BeitragVerfasst: Mo 13.08.07 12:00 
Das kannst du mit DateTimeToString machen. Die Parameter guck dir in der DelphiHilfe an. (Ist eine schöne lange liste ;) )
rolandt4088 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122

WINDOWS XP
Delphi 7, CodeGear RAD Studio
BeitragVerfasst: Mo 13.08.07 15:27 
Gelöst habe ich das Problem mit der Unit jcldatetime und mit der Komponente JvDateTimePicker.

Da gibt es die Funktion "dayofdate"

Hat prima geklappt.


Gruß Roland
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mo 13.08.07 15:46 
Man könnte auch DecodeDate() verwenden um einen Datumswert in Tag, Monat, Jahr zu wandeln.

_________________
Markus Kinzler.
little-wolf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 47

WinXP
Delphi 5 Enterprise, Delphi 2006 Enterprise
BeitragVerfasst: Mo 13.08.07 16:12 
wäre jetzt auch mein vorschlag dazu gewesen... denn wozu noch sich die mühe machen, strings zu zerlegen, wenns bereits fertige funktionen dafür gibt?

auszug aus der delphi5-hilfe:

DecodeDate gibt Jahr, Monat und Tag eines TDateTime-Wertes zurück.

Unit

Sysutils

Kategorie

Datum und Uhrzeit

procedure DecodeDate(Date: TDateTime; var Year, Month, Day: Word);

Beschreibung

DecodeDate zerlegt den im Parameter Date übergebenen Wert in die Werte Year, Month und Day. Ist TDateTime kleiner oder gleich null, werden die var-Parameter auf null gesetzt.


gruss

little-wolf