function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
naveen kunurunaveen kunuru 

confuse in using the standard code

hey hi thanks u all for giving the reply ,by the way lads i have just starting learning salesforce ,the thing is i am abit confuse were to palce this code i mean my vf and apex class is

<apex:page controller="dattim">
 <apex:form >
 <apex:pageBlock >
 <apex:pageBlockSection >
 dt<apex:outputText value="{!f1}"></apex:outputText>

 </apex:pageBlockSection>
 
 </apex:pageBlock>
 </apex:form>
 </apex:page>


apexclass;
public with sharing class dattim {

    public String f1 { get; set; }
}

i known its a shit coding ,will u guys please let me a known where to place the standard code,sing 

 
Best Answer chosen by naveen kunuru
Dushyant SonwarDushyant Sonwar
Hey Naveen,
There is no need to create any custom sobject. you can also do this by using standard object datetime field
<apex:page controller="dattim">
 <apex:form >
 <apex:pageBlock >
 <apex:pageBlockSection >
 dt<apex:outputText value="{!f1}"></apex:outputText>
   <apex:inputfield value="{!con.birthdate}" label="Name you want to give"/>
 </apex:pageBlockSection>
 
 </apex:pageBlock>
 </apex:form>
 </apex:page>
=========================
public with sharing class dattim {

    public String f1 { get; set; }
    public Contact con{get;set;}
    public dattim(){
        con =new contact();
        System.Debug(Con.birthdate +'------------');
    }
}

All Answers

Vivek_PatelVivek_Patel
Hi Navee,

Go to Setup -> App setup -> Develop -> Apex class to create new class and Setup -> App setup -> Develop -> Pages to create Visualforce page.


Regards,
Vivek Patel.
naveen kunurunaveen kunuru
hey hi ,thanks for ur reply i dont mean how to create apexclass or pages ,what i mean is to get date and time from date time field do i need to create any custome sobject having a field  name datetime ?
Dushyant SonwarDushyant Sonwar
Hey Naveen,
There is no need to create any custom sobject. you can also do this by using standard object datetime field
<apex:page controller="dattim">
 <apex:form >
 <apex:pageBlock >
 <apex:pageBlockSection >
 dt<apex:outputText value="{!f1}"></apex:outputText>
   <apex:inputfield value="{!con.birthdate}" label="Name you want to give"/>
 </apex:pageBlockSection>
 
 </apex:pageBlock>
 </apex:form>
 </apex:page>
=========================
public with sharing class dattim {

    public String f1 { get; set; }
    public Contact con{get;set;}
    public dattim(){
        con =new contact();
        System.Debug(Con.birthdate +'------------');
    }
}
This was selected as the best answer
Dushyant SonwarDushyant Sonwar
Hi Naveen,
Use this
public event   eventObj{get;set;}
public dattim (){
eventObj = new event();
}
=====================
use this field to bind on page
eventObj.ActivityDateTime