NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Webmaster Tutorials
Reload this Page Coldfusion Tutorial - Beginners - Part I

Webmaster Tutorials Instructional webmaster-related how-to's and tutorials.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 07-14-2004, 10:56 AM THREAD STARTER               #1 (permalink)
Account Closed
Join Date: Jul 2004
Posts: 22
Prototype is an unknown quantity at this point
 



Coldfusion Tutorial - Beginners - Part I


Part I

In Part I of this Beginner's Tutorial I will show how to calculate the current time in Macromedia Coldfusion.

Before you start, you need to make sure your server can receive Coldfusion pages properly. Inorder to do so you must first install the IIS server on windows XP professional via control panel and then install a free trial or full version of Coldfusion. You may also buy coldfusion hosting online. After you have done so, you may begin your work.

So let's make our first page.

PHP Code:
<html>
<
head></head>
<
body>

<
CFOUTPUT>
<
CFSET date Now()>
<
/span>>
<
b>#date#</b>
</CFOUTPUT>

</
body></html
Now save this file as date.cfm. You have just completed your first tutorial! Now let me explain how it all works.

the CFOUTPUT functions just like the BODY tag in html. Only CFOUTPUT is used for Coldfusion. Every coldfusion code that you want to display is put in between the CFOUTPUT tags.

CFSET is used to create and modify coldfusion variables. For example, we have written:

We can replace the word "date" with any other word, and it will still function the same! Try it!

the Now() function, is what really makes the difference. Now() gives the current time and date.

Remember, that you can use html tags along with coldfusion tags!

So if you would use the code above, your result would look something like this:

Quote:
{ts '2004-14-07 12:52:20'}
In the next tutorial, I will show you how to customize this date to make it formatted anyway you want. You will be able to make it more understandable, for ex: January 12, 2004. or however you want it to be. But that will be all covered in the next tutorial!
????: NamePros.com http://www.namepros.com/showthread.php?t=38759


Thanks for Reading!
Prototype is offline  
Old 07-14-2004, 07:50 PM   #2 (permalink)
Sheriff Of Nothing
Join Date: Apr 2004
Location: Florida
Posts: 220
Ethan is an unknown quantity at this point
 



Nice, this will come in handy as I never learned ColdFusion but have it on disk from a friend, older version, but I figure I can play around with it
__________________
Lowter.com - Webmaster eZine and Community
Interactive eZine, Articles, Blogs, and More
Norics.com | Cascading Design | Blue Programming
Ethan is offline  
Old 07-14-2004, 09:04 PM THREAD STARTER               #3 (permalink)
Account Closed
Join Date: Jul 2004
Posts: 22
Prototype is an unknown quantity at this point
 



Yes it does work with the older versions.

Here is a continuation of Part I, now I will show how to modify the date to make it look the way you would like it to look.

Open up the same page now change the cfset parameter to this:



PHP Code:
<cfset date DateFormat(now(), "mmmm d, yyyy")> 
With this new function we have changed how the date will appear. Save the file and reload the page. Your result should look like this:
????: NamePros.com http://www.namepros.com/showthread.php?t=38759

Quote:
July 15, 2004
That is all there is to formating and displaying the date. You may format it in whatever order you wish. For example it can be yyyy-d-mmmm or however you decide it to be.

Here are all of the different possibilies that you may use:

"mmmm" -> Month
"yyyyy" -> Year
"dddd" -> Day of the week
"d" -> Date

So, the following output: dddd mmmm yyyy would result in:

Quote:
Friday July 2004
Enjoy!
Prototype is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 04:16 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger