web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Problemas con fecha
Power Apps
Answered

Problemas con fecha

(4) ShareShare
ReportReport
Posted on by 115
Hola tengo el problema con la fecha, al momento de guardar en mi SharePoint la guarda con un día anterior
 
 
Pero en la aplicación si me la da correcto con el mismo día
 
 
Es algo que hay que estoy haciendo mal al momento de guardar la fecha y hora?
 
O sera alguna configuración de SharePoint
 
Ya configure formato y zona horaria
 
 
I have the same question (0)
  • Suggested answer
    Haque Profile Picture
    3,653 on at
    Hola @IS-12031616-0,
     
    Este comportamiento es muy común al trabajar con campos de fecha y hora de SharePoint; no es que su aplicación esté "mal", sino que SharePoint siempre almacena las fechas en UTC internamente y luego aplica la configuración regional/de zona horaria del sitio al mostrarlas.
     
    En tu aplicación, probablemente estés pasando una fecha sin hora (por ejemplo, 2026-03-27). Tenga en cuenta que SharePoint interpreta esto como la medianoche UTC (2026-03-27T00:00:00Z). Pero su sitio está configurado en UTC-06:00 (México). La medianoche UTC sigue siendo el día calendario anterior en esa zona (2026-03-26 18:00).
     
    Ejemplo: Convertir UTC a hora estándar central (UTC-6) en la aplicación: 
    DateAdd(DateTimeValue(ThisItem.DOJ), -6, Hours)
    
     
    Otra opción es almacenar solo la fecha (sin la hora). En SharePoint, configure el tipo de columna como "Solo fecha" en lugar de "Fecha y hora". De esta forma, SharePoint ignora las zonas horarias y solo almacena la fecha del calendario que usted especifique.
     

    Estoy seguro de que algunas de las pistas que intenté darte te fueron útiles. Si estas pistas te ayudan a resolver el problema que trajiste aquí, no olvides marcar la casilla "¿Responde esto a tu pregunta?". ¡Además, estoy seguro de que te gustó la respuesta!
  • IS-12031616-0 Profile Picture
    115 on at
    En SharePoint modifique el campo de "Solo fecha" en lugar de "Fecha y hora". pero al hacer eso ahora en la aplicacion me pone la fecha anteriro como en el SharePoint
     
    El codigo que me comentas en donde lo pongo? OnChange - EndDate - DateTimeZone
     
    DateAdd(DateTimeValue(ThisItem.DOJ), -6, Hours)
     
     
  • Suggested answer
    Valantis Profile Picture
    6,735 on at
     
    Patch(
      YourSharePointList,
      Defaults(YourSharePointList),
      {
        YourDateColumn: DateValue(DatePicker1.SelectedDate)
      }
    )
    Replace YourSharePointList, YourDateColumn and DatePicker1 with your actual names.

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

     

  • Verified answer
    Haque Profile Picture
    3,653 on at
     
    Hola @IS-12031616-0,
     
    Lo siento, olvidé mencionar dónde colocar el código.

    En Power Apps, cuando parcheas o envías un formulario a SharePoint:
     
    Patch(
        'MySharePointList',
        Defaults('MySharePointList'),
        {
            Title: TextInput1.Text,
            DOJ: DateAdd(DateValue(DatePicker1.SelectedDate), -6, Hours)
        }
    )
    
     
     
    Si su columna de SharePoint es solo de tipo Fecha, puede usar con seguridad: DateValue(DatePicker1.SelectedDate)
    Esto elimina la hora y guarda solo la fecha del calendario. SharePoint no aplica cambios de zona horaria a los campos de "Solo fecha".
     
     
    Si la columna de SharePoint es "Fecha y hora", normalice la hora antes de guardar para que no retroceda un día:
     
    DateAdd(DateValue(DatePicker1.SelectedDate), 12, Hours)
     
     
    Si desea alinear explícitamente la hora con la zona horaria de su sitio (por ejemplo, UTC-6 para México):
    DateAdd(DateTimeValue(DatePicker1.SelectedDate), -6, Hours)
     
    Nota: Si desea incluir la fecha en una etiqueta o texto después de seleccionarla en el selector de fechas, puede hacerlo en la fórmula de texto de Power Apps y guardar esta etiqueta/texto:
    Text(DateAdd(DateTimeValue(DatePicker1.SelectedDate), -6, Hours), "mm/dd/yyyy") //ajustado a la hora estándar central (UTC-6)
     
     
     
    Gracias!
     
     
  • Verified answer
    WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
    I will add to @Haque's post here regarding UTC with another possibility - your SharePoint site Regional Settings and that of the local device running Power Apps may be different.
     
    If they are the same, you should have the correct date and time viewed in both SharePoint and Power Apps.
     
    All dates in the SharePoint data storage are stored in the UTC time of the local value they were written that value is then converted automatically by the Regional Settings of either the local device or the SharePoint interface/view when needed.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard