Digital Clock in Salesforce
Digital clock Functionality in salesforce.
<html>
<head>
<META http-equiv="refresh" content="10"/>
</head>
</html>
<apex:form >
<apex:pageBlock title="time">
<apex:pageBlockSection >
<apex:pageBlockSectionItem >
<apex:outputText value="{0,date,MMMM dd, yyyy,'', HH:MM:SS:MS}">
<apex:param value="{!TODAY()}" />
</apex:outputText>
{!displayval}
{!display}
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:commandButton value="click" action="{!display}"/>
</apex:pageBlock>
</apex:form>
</apex:page>
public String getToday() {
return null;
}
public String today { get; set; }
public PageReference display() {
display=DateTime.now().format('dd-MM-yyyy HH:mm:ss');
return null;
}
public String getDisplayval() {
return null;
}
public String displayval { get; set; }
public String getDisplay() {
return null;
}
public string display { get; set; }
}
------- Visual Force Page------
<apex:page controller="mydigitalc"><html>
<head>
<META http-equiv="refresh" content="10"/>
</head>
</html>
<apex:form >
<apex:pageBlock title="time">
<apex:pageBlockSection >
<apex:pageBlockSectionItem >
<apex:outputText value="{0,date,MMMM dd, yyyy,'', HH:MM:SS:MS}">
<apex:param value="{!TODAY()}" />
</apex:outputText>
{!displayval}
{!display}
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:commandButton value="click" action="{!display}"/>
</apex:pageBlock>
</apex:form>
</apex:page>
----controller ---
public class mydigitalc {public String getToday() {
return null;
}
public String today { get; set; }
public PageReference display() {
display=DateTime.now().format('dd-MM-yyyy HH:mm:ss');
return null;
}
public String getDisplayval() {
return null;
}
public String displayval { get; set; }
public String getDisplay() {
return null;
}
public string display { get; set; }
}
Comments
Post a Comment