# When I synchronize 2 field Date Picker synchronizes with one day less

**URL:** <https://community.exalate.com/t/when-i-synchronize-2-field-date-picker-synchronizes-with-one-day-less/6105>\
**Category:** General Questions\
**Created:** [January 10, 2025, 7:12am UTC](https://community.exalate.com/t/when-i-synchronize-2-field-date-picker-synchronizes-with-one-day-less/6105 "2025-01-10T07:12:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrey\_Miranda](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/andrey_miranda/32/435_2.png) [@Andrey\_Miranda](https://community.exalate.com/u/Andrey_Miranda)\
**Post date:** [January 10, 2025, 7:12am UTC](https://community.exalate.com/t/when-i-synchronize-2-field-date-picker-synchronizes-with-one-day-less/6105/1 "2025-01-10T07:12:24Z")

</div>

Good afternoon ,

I have a connection from project A in a cloud instance and project B in another data center version instance. I need to synchronize the value of a field called ETA. The fields are Date Picker type.

but when it comes to synchronizing the fields, it is synchronized in project B one day before what was placed. Does anyone know how I can solve this with the Date Picker type field?

---

<div class="post-metadata">

**Author:** ![Jillani\_Fazal](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/jillani_fazal/32/355_2.png) [@Jillani\_Fazal](https://community.exalate.com/u/Jillani_Fazal)\
**Post date:** [January 10, 2025, 7:14am UTC](https://community.exalate.com/t/when-i-synchronize-2-field-date-picker-synchronizes-with-one-day-less/6105/2 "2025-01-10T07:14:22Z")

</div>

hi @Andrey_Miranda

The same scenario was discussed and you can follow it here:

> [@Why are my custom field sync dates 1 day off?](https://community.exalate.com/t/why-are-my-custom-field-sync-dates-1-day-off/4771):
>
> Originally asked by Suzanne May on 10 July 2021 [(original question)](https://oldcommunity.exalate.com/questions/30049374) I have Jira server to Jira server set up. I am syncing a custom field date in one to the custom field date in the other. For some reason when the dates are syncing they sync 1 day off. example from system has date 12/3/2021 the to system has 12/2/2021. How can I get them to sync exactly? Outgoing(Target Start and end are from Portfolio Jira) replica.customFields.“Target start” = issue.customFields.“Target start” replica.c…

Let me know if you found the shared information helpful.

BR,  
Jillani

---

<div class="post-metadata">

**Author:** ![Andrey\_Miranda](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/andrey_miranda/32/435_2.png) [@Andrey\_Miranda](https://community.exalate.com/u/Andrey_Miranda)\
**Post date:** [January 11, 2025, 3:05am UTC](https://community.exalate.com/t/when-i-synchronize-2-field-date-picker-synchronizes-with-one-day-less/6105/3 "2025-01-11T03:05:04Z")

</div>

Hello @Jillani_Fazal

Before sending the query I read the post but according to what is in the post they did not solve the issue.

I found something similar in a post with the Due date field, I tried to change the code to this one but it doesn’t work, do you know if the case can be solved at the code level?

> [@Difference of one day with "Due date" synchronization](https://community.exalate.com/t/difference-of-one-day-with-due-date-synchronization/5091):
>
> Originally asked by Tomás Martynowicz on 03 March 2022 [(original question)](https://oldcommunity.exalate.com/questions/42833842) Hello, I am synchronizing due date from Jira Server instance to a JSM cloud instance using this syntax : replica.due = issue.due #On server instance issue.due = replica.due #On JSM instance The due date is synchronized each time with -1 day of difference on JSM.

---

<div class="post-metadata">

**Author:** ![Jillani\_Fazal](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/jillani_fazal/32/355_2.png) [@Jillani\_Fazal](https://community.exalate.com/u/Jillani_Fazal)\
**Post date:** [January 13, 2025, 6:18am UTC](https://community.exalate.com/t/when-i-synchronize-2-field-date-picker-synchronizes-with-one-day-less/6105/5 "2025-01-13T06:18:39Z")

</div>

Hi @Andrey_Miranda

Thank you for the update. Will be working with you on the ticket which I have just updated.

Appreciated.

BR,  
Jillani

---

<div class="post-metadata">

**Author:** ![Tomas\_Lalanne](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/tomas_lalanne/32/447_2.png) [@Tomas\_Lalanne](https://community.exalate.com/u/Tomas_Lalanne)\
**Post date:** [February 5, 2025, 10:38am UTC](https://community.exalate.com/t/when-i-synchronize-2-field-date-picker-synchronizes-with-one-day-less/6105/6 "2025-02-05T10:38:44Z")

</div>

Hi @Andrey_Miranda, As mentioned on the ticket, here is the script for other to use in case of having the same issue

**Outgoing script**

replica.customFields.“DatePicker” = issue.customFields.“DatePicker”

_ **Incoming script** _

import java.text.SimpleDateFormat

if (replica.customFields.“DatePicker”) {  
def dateValue = replica.customFields.“DatePicker”.value // Extract actual date

```
if (dateValue) {
    // Remove time part if present (keep only YYYY-MM-DD)
    def cleanedDate = dateValue.toString().split(" ")[0]

    // Parse as LocalDate
    def parsedDate = java.time.LocalDate.parse(cleanedDate)

    // Add 1 day
    def adjustedDate = parsedDate.plusDays(1)

    // Convert to Java Date object (required for Jira fields)
    def sdf = new SimpleDateFormat("yyyy-MM-dd")
    def finalDate = sdf.parse(adjustedDate.toString()) // Convert to Date object

    // Assign the corrected Date object back to Jira
    issue.customFields."DatePicker".value = finalDate
}

```

}

In case of needing to Subtract 1 day  
def adjustedDate = parsedDate.plusDays(1)  
to  
def adjustedDate = parsedDate.minusDays(1)

BR  
Tomas Lalanne
