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.
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:
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!
Thanks for Reading!
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:
<html>
<head></head>
<body>
<CFOUTPUT>
<CFSET date = Now()>
<br>
<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:
PHP:
<CFSET date = Now()>
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:
{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!
Thanks for Reading!