Skip to main content

Healthcare Systems Article Category

Medical Factors Which make it The most effective  just by Sejal Kakadiya  Medicine and health agencies with now consentrate on top quality, charge together with great satisfaction health of their solutions. These are typically that support beams which a lot of these agencies redefine the direction they trade. The following really results in thrilled clients.  How come Serious Treatment Direction Can be a Trend Inside Medicine and health Sector  just by Steven Orange  A whole lot of North american healthcare systems' options are generally about that direction together with procedure with serious circumstances. Direction with serious health conditions which include diabetes, excessive circulation demand, cardiovascular disease, together with hypothyroidism can be a vital component of easiest treatment healthcare provider's succeed. Inside standard product, that general practitioner spots someone on an automobile accident with treatment, inspects that condition ...

How to Display Date Format in JavaScript?


How to Display Date Format in JavaScript?You can display different date format using Date object in JavaScript for your webpage or web application.The different date format may be year only (YYYY), year and month (YYYY-MM), complete date (YYYY-MM-DD), complete day with day name (YYYY-MM-DD DayName) and date with different time format. Different methods are available in date object to manipulate date in JavaScript. The Date object automatically hold the current date and time as its initial value. You can extract Year, Month, Day along with Hours, Minutes and Seconds from it. Here I have given very simple codes for printing different date formats, you can use respective codes for displaying that format of date on your web page.



JavaScript Date Format YYYY (year only)


<script type="text/javascript">
function displayDate(){
var now = new Date();
var year=now.getFullYear();
date.innerHTML=year
}
window.onload=displayDate;
</script>
<div id="date"></div>

It prints Year only. i.e. 2014


JavaScript Date Format YYYY-MM or MM-YYYY (year and month) 


<script type="text/javascript">
function displayDate(){
var now = new Date();
var month=now.getMonth();
var monthName=new Array(12)
monthName[0]="January";
monthName[1]="February";
monthName[2]="March";
monthName[3]="April";
monthName[4]="May";
monthName[5]="June";
monthName[6]="July";
monthName[7]="August";
monthName[8]="September";
monthName[9]="October";
monthName[10]="November";
monthName[11]="December";
var year=now.getFullYear(); 
date.innerHTML=monthName[month]+", "+year
}
window.onload=displayDate;
</script>
<div id="date"></div>

It prints Year and Month. i.e. February, 2014

JavaScript Date Format YYYY-MM-DD (complete date)


<script type="text/javascript">
function displayDate(){
var now = new Date();
var today=now.getDate();
var month=now.getMonth();
var monthName=new Array(12)
monthName[0]="January";
monthName[1]="February";
monthName[2]="March";
monthName[3]="April";
monthName[4]="May";
monthName[5]="June";
monthName[6]="July";
monthName[7]="August";
monthName[8]="September";
monthName[9]="October";
monthName[10]="November";
monthName[11]="December";
var year=now.getFullYear();
var day=now.getDay();
date.innerHTML=monthName[month]+today+ ", "+year
}
window.onload=displayDate;
</script>
<div id="date"></div>

It prints Year, Month and Day. i.e. February21, 2014


JavaScript Date Format YYYY-MM-DD-DayName (date with day name)


<script type="text/javascript">
function displayDate(){
var now = new Date();
var today=now.getDate();
var month=now.getMonth();
var monthName=new Array(12)
monthName[0]="January";
monthName[1]="February";
monthName[2]="March";
monthName[3]="April";
monthName[4]="May";
monthName[5]="June";
monthName[6]="July";
monthName[7]="August";
monthName[8]="September";
monthName[9]="October";
monthName[10]="November";
monthName[11]="December";
var year=now.getFullYear();
var day=now.getDay();
var dayName=new Array(7)
dayName[0]="Sunday";
dayName[1]="MOnday";
dayName[2]="Tuesday";
dayName[3]="Wednesday";
dayName[4]="Thrusday";
dayName[5]="Friday";
dayName[6]="Saturday";
date.innerHTML=monthName[month]+today+ ", "+year+" "+dayName[day]
}
window.onload=displayDate;
</script>
<div id="date"></div>

It prints Year, Month and Day with Day Name. i.e. February21, 2014 Friday

JavaScript Date Format YYYY-MM-DD hh:mm (date with hour and minute)


<script type="text/javascript">
function displayDate(){

var now = new Date();
var today=now.getDate();
var month=now.getMonth();
var h=now.getHours()
var m=now.getMinutes()
var s=now.getSeconds()

m=checkTime(m)
s=checkTime(s)

var monthName=new Array(12)
monthName[0]="January";
monthName[1]="February";
monthName[2]="March";
monthName[3]="April";
monthName[4]="May";
monthName[5]="June";
monthName[6]="July";
monthName[7]="August";
monthName[8]="September";
monthName[9]="October";
monthName[10]="November";
monthName[11]="December";

var year=now.getFullYear();
var day=now.getDay();

var dayName=new Array(7)
dayName[0]="Sunday";
dayName[1]="MOnday";
dayName[2]="Tuesday";
dayName[3]="Wednesday";
dayName[4]="Thrusday";
dayName[5]="Friday";
dayName[6]="Saturday";

date.innerHTML=monthName[month]+today+ ", "+year+" "+h+":"+m
}
function checkTime(i)
{
if (i<10)
{ i="0" + i}
return i
}
window.onload=displayDate;
</script>
<div id="date"></div>

It prints Year, Month and Day with Hour and Minute. i.e. February21, 2014 9:18

To include other time formats refer to the previous post: How to Create a Digital Clock in JavaScript?


Related Posts


Comments

Popular posts from this blog

Solved MCQ of Computer Security set -1

1. In computer security, ……………………. means that computer system assets can be modified only by authorized parities. A) Confidentiality B) Integrity C) Availability D) Authenticity 2. In computer security, …………………….. means that the information in a computer system only be accessible for reading by authorized parities. A) Confidentiality B) Integrity C) Availability D) Authenticity 3. The type of threats on the security of a computer system or network are …………………….. i) Interruption                   ii) Interception                  iii) Modification iv) Creation                         v) Fabrication A) i, ii, iii and iv only B) ii, iii, iv and v only C) i, ii, iii and v only D) All i, ii, iii, iv and v 4. Whi...

Solved MCQ for IT Officer Exam Part-2

SWIFT Logo (Photo credit: Wikipedia ) 1. SWIFT stands for: A) Society for Worldwide Interbank Financial Telecommunication B) Society for Worldwide International Financial Telecommunication C) Society for Worldwide Interbank Financial Transmission D) Society for Worldwide Interbank Financial Transfer 2. Which one is the correct statement? A) XML is a technology used only on the internet. B) XML is a programming language. C) XML is highly suitable data exchange between two different systems. D) XML is scripting language. 3. Decision support systems usually A) serve managers interested in weekly, monthly and yearly results, not day-to-day activities. B) help managers make decisions that are unique, rapidly changing and not easily specified in advance. C) provide managers with a generalized computing and telecommunications capacity that can be applied to a changing array of problems. D) perform and record the daily routine transactions necessary to the conduct of business. 4. Identifying...

Solved MCQ on Fundamental of C Language set-7

1) 'C' allows a three way transfer of control with the help of A. Unary Operator B. Relational Operator C. Ternary Operator D. Comparison Operator 2) Operators have hierarchy. It is used to know which operator .... A. is most important B. is used first C. is faster D. operators on large numbers 3) The statement that transfers control to the beginning of the loop is called .. A. break statement B. exit statement C. continue statement D. goto statement 4) C programming language was developed by .. A. Dennis Ritche B. Ken Thompson C. Bill Gates D. Peter Norton 5) The value that follows the keyword CASE may only be A. constants B. variable C. number D. semicolon 6) In a C language 'a' represents ... A. a digit B. an integer C. a character D. a word 7) The statement which is used to terminate the control from the loop is A. break B. continue C. goto D. exit 8) The continue command cannot be used with .... A. for B. switch C. do D. while 9) A self contained block of statement...