Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 14:32

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



C# DateTime Struktur Problem

Discussion on C# DateTime Struktur Problem within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2009
Posts: 5
Received Thanks: 0
C# DateTime Struktur Problem

Hey,
ich hab ein Problem... ich möchte eine Anloguhr darstellen, dazu benutz ich eine fertige .dll von CodeProject:
Nun will ich eine eigene Zeit einstellen (nicht DateTime.Now)...
Wie bei CodeProject klappt der Code ganz gut...
Code:
analogClock1.Time = DateTime.Now;
Nur will ich ja eine eigene Zeit....
Ich hab schon einiges ausprobiert, aber iwie habe ich immer einen Fehler drin
Code:
                String MyString;
                MyString = "15.11.2011 " + sys_hour + ":" + sys_min + ":" + ":" + sys_sec + " p.m.";

                DateTime MyDateTime;
                MyDateTime = new DateTime();
                MyDateTime = DateTime.ParseExact(MyString, "M/d/yyyy hh:mm:ss tt", null);

                DateTime dt = new DateTime(1999, 9, 1, 5, 6, 47);
                DateTime testc = new DateTime(1994, 11, 11, 10, 20, 30);
                //analogClock1.Time = testc;
 analogClock1.Time = dt;
Hoffe ihr könnt mir helfen....
MFG Waschi

Hey,
so habs hin bekommen
Hier die Lösung:
Code:
               
DateTime customTime = new DateTime(1994, 11, 11, sys_hour, sys_min, sys_sec, DateTimeKind.Unspecified);
                analogClock1.Time = customTime;
Am ende nicht DateTimeKind.Unspecified vergessen, wie ich
waschiwaschi is offline  
Reply


Similar Threads Similar Threads
datetime and count
09/14/2010 - CO2 Private Server - 2 Replies
okay i was trying to count how long an action took. but it counted how long it took to send the action, but not how long it took. How can i make it count after the action is send. And yea I did put the time after the action, but still doing it. Something I can use to check if action is done? Is for 5165 tanel.
DateTime Guild War
12/16/2009 - CO2 Private Server - 5 Replies
Alright well in the 5165 source I made a datetime start for guild war. Here's the code. public static void GuildWarTime()// On or Off { if (DateTime.Now.DayOfWeek == DayOfWeek.Wednesday && DateTime.Now.Hour == 2 && DateTime.Now.Minute == 15) { StartWar(); } }
[QUESTion] DateTime Help
07/23/2009 - CO2 Private Server - 6 Replies
Ok im looking at this one datetime im trying to make one but i dont understand this hour part where it says ServerTime.Hour == 8 what time is the 8 lol else if ((World.ServerTime.DayName == "Monday" || World.ServerTime.DayName == "Wednesday") && World.ServerTime.Hour == 8 && World.ServerTime.Minute == 50)
[HELP] Datetime error
06/23/2009 - CO2 Private Server - 0 Replies
Ok im geting this error when i try to load 10 expballs per day here it is http://img188.imageshack.us/img188/8279/erroryfn.p ng



All times are GMT +1. The time now is 14:32.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.