Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 22nd, 2004, 07:16 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aadz5
Default Date and Time

Guys I get this error:-

Compiler Error Message: CS0118: 'ASP.TMPepdsatie08_aspx.dTime' denotes a 'field' where a 'class' was expected

Source Error:

Line 11: //private DateTime dtNow = DateTime.Now;
Line 12: string longDateString = dTime.ToLongDateString();
Line 13:
Line 14: private void Page_Load(object sender, EventArgs e)

When I input this data

System.DateTime dTime = new System.DateTime(2001, 5, 16, 3, 2, 15);

//private DateTime dtNow = DateTime.Now;
string longDateString = dTime.ToLongDateString();

Any ideas



Adz - The World is not enough
__________________
Adz - Learning The J2EE Ways.
 
Old February 22nd, 2004, 11:19 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

From the looks of the error message, this code isn't inside a function. This might be causing the problem.
 
Old February 23rd, 2004, 02:43 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aadz5
Default

Peter,

thankyou, I was wondering if you knew a easy way to add todays date into a aspx web page?? You were right but I cant seem to get an overload of DateTime that gives todays date in long format only??




Adz - The World is not enough
 
Old February 23rd, 2004, 02:53 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

What about System.DateTime.Now.ToLongDateString()?
 
Old February 24th, 2004, 02:20 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aadz5
Default

Thanks Man:)

Adz - The World is not enough





Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting Time from Date/Time Navy1991_1 XSLT 2 June 3rd, 2008 12:03 PM
date and time in EST time zone anboss XSLT 1 May 21st, 2008 01:42 PM
How to retieve only the date not date and time debjanib ASP.NET 1.0 and 1.1 Professional 2 July 25th, 2006 01:10 PM
insert system date. no date and time jimmy Access VBA 6 November 20th, 2003 01:11 PM
Date and Time scottma135 VB Components 0 August 26th, 2003 10:02 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.