Digital Clock in Salesforce

Digital clock Functionality in salesforce.

------- 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

Popular posts from this blog

Community/Experience Cloud Interview Questions

Script to delete multiple records using Apex salesforce

Change Owner / Update record using Lightning Custom Button Salesforce