blah blah blah is here! blah blah » Close

1
votes
1 answers

Noob question about date and time in c sharp

Dear all, for getting a current time in c sharp, a [code]DateTime[/code] class is used and by using [code]DateTime.Now[/code] as its implementation. The question is I have [code]int[7][/code] and I want to put every info inside the [c ...

1
votes
4 answers

How to calculate someones age using their birthday in c#?

Rick_A
761

If I have a DateTime object that is initialized with a users birthday, how can I calculate their age? So say I have: [code]DateTime birthday = new DateTime(1965, 01, 25);[/code] How can I derive their current age?

0
votes
1 answers

C# DateTime.TimeOfDay

How do I split DateTime.TimeOfDay into seperate integers for Minute, Second and Hour as well as a Boolean for AM/PM? Thanks, Theo

0
votes
1 answers

the exploitation of risk averse cultures

Is there a risk-averse culture definition? A risk-averse culture is probably unambiguous and will only accept 4 digit years and only in a W3C/ISO kind of date format which is year/month/day. Note that to implement your own for dates can ...

0
votes
3 answers

Parse DateTime Exact

How can i parse the below datetime as exact? [code]DateTime dt = DateTime.Parse(row.Cells[2].Value.ToString());[/code] when the above code is executed i get error: 'String was not recognized as a valid DateTime.' the format of the ...

1
votes
1 answers

help with getting an accurate DateTime.Now object. I keep getting 12:00am

[code]DateTime CurrTime = DateTime.Now; txtStarted.Text = CurrTime.Date.ToShortTimeString();[/code] The clock on my computer says 2:31pm, but it keeps displaying 12:00a

0
votes
1 answers

Problem in setting DateTime value explicitly.

I want to pick a value from a DateTimePicker in 'MM/dd/yyyy hh:mm tt' format, add 00 as second with it, store it in a DateTime variable and save it to database. Suppose if I pick the value 05/28/2010 9:25 AM or 05/28/2010 9:25:34 AM from th ...

0
votes
1 answers

Problem with DateTime matching.

I'm trying to match a certain DateTime value with the current system DateTime. I have a timer and a label on a form. Timer interval is set to 1000. When the form loads, the timer starts ticking. As soon as the current DateTime matches the v ...

0
votes
1 answers

A few simple data grid questions - date formatting, headers, and a string question

Hi, I have a few questions, and I'm really, REALLY new to C#, trying to make the change from VBA (in which I'm self taught), so if you need more details or larger bits of code, let me know. Thanks in advance :) The datagrid I'm using i ...

0
votes
3 answers

Datetime problems

Hi all I'm doing a web application in VS2008 with Sql server database, and I do not seem to find a solution to my problem. I have two textboxes where I enter from date and to date, and when I push the button it will populate a couple o ...

0
votes
1 answers

MySQL DateTime and C# System.DateTime

I understand that C# System.DateTime values are formatted differently from MySQL DateTime, which are: yyyy-MM-dd HH:mm:ss. in mysql prompt, I have this, which is successfully inserted those values. mysql> insert into sales (Sale_Date ...

0
votes
1 answers

Gridview question

Hi I have a gridview in my asp.net webapplication (I'm using VS2008) and from my sql server database it populates that gridview. I'm doing a time registration application and my columns are "date" "time beginning" &qu ...

0
votes
1 answers

Date and time in gridview

Hi I don't know if this is a big issue, but I don't seem to find a solution when I google around. I have a gridview and I want the users to fill in what date they worked and also what time they start working and end working. I've used dat ...

3
votes
1 answers

Cannot Implicity Convert 'String' To 'System.DateTime'

Hi, i'm trying to debug this line of code: [code] dateTimePicker1.Value = ap.Start.ToString("dd/MM/yyyy HH:mm:ss", null); [/code] but keep getting the folowing error? Cannot Implicity Convert 'String' To 'System.DateTim ...

Feedback